UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Issues With A Form (and Help With Codes)    
 
   
hawk7890
post Mar 22 2012, 08:44 PM
Post #1

UtterAccess Addict
Posts: 203



Good day,

I am getting an error message with one of my forms when I open it from Design view, and I cannot figure out why. All I was able to figure out is it only happens when I have the following code: (form is frmLoanEdit)
Private Sub Form_Load()
End Sub

If someone is available to help me with a few pieces of code I seem unable to figure out. (frmLoanEdit)
the idea is simple enough, when you use frmLoanSearch and search an asset (say C3333), frmLoanEdit opens on that loan record. Can you assist with the following?

-Display the asset number and asset details
-OtherEquipmentLoanSubform: not sure how to build this, the idea is all the items are listed, and when a client borrows a piece of equipment, you put a check for yes or no.
-When ExtendedReturnDate field is changed it automatically enables Extended. Also calculates to ensure the difference between initial loandate and entered date is no more than 20 days
-When callback done button is pressed it adds todays date and the name of the currentuser

Thanks
Marc
Attached File(s)
Attached File  db5.zip ( 64.04K ) Number of downloads: 11
 
Go to the top of the page
 
+
missinglinq
post Mar 23 2012, 08:41 AM
Post #2

UtterAccess Ruler
Posts: 2,669



Your app has apparently become Corrupted. Fortunately, I was able to get rid of the error using the easiest method for recovering a Corrupted database:
  1. Create a new, blank database file
  2. Go to File - Get External Data - Import
  3. Select the original db file
  4. Go thru all types of of Objects, clicking on Select All
  5. When done hit OK
  6. Save the New Database File with a temporary name
  7. Rename and retain your original file (as a safety measure)
  8. Rename your new file using the name of the original db
You should now be set.

Linq ;0)>
Go to the top of the page
 
+
hk1
post Mar 23 2012, 09:18 AM
Post #3

UtterAccess Veteran
Posts: 400



I agree that it looks like your database has somehow become corrupted and missinglinq's suggestion is probably your only option.

I did note a problem that I recommend you check out. First off, you aren't using the Option Explicit declaration at the top of each module. Because of this you are using a global variable on one of your forms that doesn't exist.

At the top of your forms you should have:
CODE
Option Compare Database
Option Explicit


In case you don't already know, it is a best practice to frequently run the Compile Database option which is located on the debug menu in the VBA editor. It's also good to run Compact and Repair occasionally. However, neither of things will fix the problem you're currently having.
Go to the top of the page
 
+
hawk7890
post Mar 23 2012, 02:22 PM
Post #4

UtterAccess Addict
Posts: 203



Thank you

I will do the change suggested. You mentioned that I am using a global variable that doesn't exist, which variable are you reffering to? I have 3 variables called gfullname, gusername, guserrights. Those are actually in use on the welcome form, I just hard coded a value in them in order not to generate an error when I upload it for assistance.

Thanks
Marc
Go to the top of the page
 
+
hk1
post Mar 23 2012, 03:46 PM
Post #5

UtterAccess Veteran
Posts: 400



I think the one that was missing in mdlUser was gUserRights.

This is all I saw in there:
CODE
Public gFullName As String
Public gAccessType As String
Public gLoginName As String


If you use the Option Explicit statement in all of your modules it will help you avoid this problem since it prevents you from using a variable which has not been declared.
Go to the top of the page
 
+
hawk7890
post Mar 23 2012, 10:05 PM
Post #6

UtterAccess Addict
Posts: 203



Thank you, I see where I did the mistake and resolved it.

Any chance someone could assist with the other questions I listed? I am really stumped with those.

thanks
Marc
Attached File(s)
Attached File  db6.zip ( 60.8K ) Number of downloads: 0
 
Go to the top of the page
 
+
hk1
post Mar 24 2012, 06:36 AM
Post #7

UtterAccess Veteran
Posts: 400



Here it is. I just followed the instructions that missinglinq posted above.
Attached File(s)
Attached File  db6.zip ( 72.62K ) Number of downloads: 5
 
Go to the top of the page
 
+
hawk7890
post Mar 24 2012, 09:56 PM
Post #8

UtterAccess Addict
Posts: 203



Yes the fix that missinglink posted worked. I was wondering if anyone is able to assist me with some code for the following that I would like to accomplish.
The codes would be on frmLoanEdit
First, when you use frmLoanSearch and search an asset (say C3333), frmLoanEdit opens on that loan record. Can you assist with the following?

-Display the asset number and asset details in controls that do not have scrollbars
-OtherEquipmentLoanSubform: not sure how to build this, the idea is that all the items are listed, and when a client borrows a piece of equipment, you put a check for yes or no.
-When ExtendedReturnDate field is changed it automatically changes the setting of extended to yes, it also calculates to ensure the difference between initial loandate and entered date is no more than 20 days
-When callback done button is pressed it adds todays date and the name of the currentuser

Thanks
Marc

Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 25th May 2013 - 09:15 PM