Buttons/Navigations/control properties

KristenD

Registered User.
Local time
Today, 14:36
Joined
Apr 2, 2012
Messages
394
I oopsed...BIG TIME! I really need your help.

My buttons no longer work on my forms. I had a find button on the main form of my database but no matter how many times I delete the button and re add it to the main form, it will no longer search the database.

I added a new Sub form that will not allow me to move from the record because it says "The Microsoft Office Access database engine cannot find a record in the table 'tblJobs' with key matching field(s) 'Job Number'".

I'm guessing because the field is blank. But I set the properties to Null is ok. Then I tried to gray it out by adding control properties and locking it and that didn't work.

Please help I am at my wits end having been trying to get this worked out for almost a week and I am not getting any closer to the solution!!
 
Please look at the attachment this is what happens when I use the ribbon "Find"
 

Attachments

  • cmdFInd.JPG
    cmdFInd.JPG
    32 KB · Views: 83
What is the Record Source of your form?
And show us the Find code.
 
This is what is in the code:

Code:
Option Compare Database
Private Sub cmdFindEmp_Click()
    
End Sub

I haven't added or changed anything from deleting or adding the button to the form.
 
There's no code in the event. You didn't tell me what the Record Source property of the form is.
 
The Record Source is the Main Form which is based on tblEmployee and the PK EmployeeID
 
Ok, but you have no code in the Click event so nothing is firing.
 
Is it because I added a second subform?

In the earlier versions of my db I only had one subform (it is set up for for 4 subforms and I just added the second subform) and there is no VB on that database. But when I added the second form it now has that in the VB but the button will only work on the first subform in the tab and the second subform does not automatically populate with the Employee ID like it does on the first form.

When using the tab control for the subforms does this require a lot of coding?
 
Go to that event on the working form and copy the code from there. The code you pasted is just what we call the signature of an event, i.e. the beginning and ending of the event's code block. The same may apply for your new subform too, there's no code or the code is not attached to the event in the property sheet.
 
This is what is in the working form without the second form added:

Code:
Option Compare Database
Private Sub Form_BeforeUpdate(Cancel As Integer)
End Sub

I did not write the first event in the the live db. Should this be what is in the VB?
 
Again, that's not code it's just a signature. There's no code there so your problem may not be code related. Is there any code behind the working form?
 
No, there is not. But it does work on the first subform on both the live and the backup db. It's the second form that causing the problem, I think and I'm not sure why. Because I can use the button on that first tabbed subform and I can find all the employees but when I go to the second tab subform the buttons cease to work.
 
If there's no code behind the Click event, is there a macro attached to it?
 
I set it up through the wizard and the only macro I have in the db is the Auto FE updater.
 
Upload a cut down version of your db let me have a look.
 
I am working in A2007 do you need me to save it as an earlier version?
 
For the benefit of all, in case someone else might want to chime in, upload it in 2003. Actually, upload 2007 and 2003.
 
Right, so what forms am I supposed to be looking at? And what steps should I take to reproduce the problem?

I'm also hoping that you didn't include any sensitive data in your upload?
 

Users who are viewing this thread

Back
Top Bottom