Hi all I’m looking for help again, I thought I had solved a problem but have not. I have three database tables. One with part numbers description make etc in it and another with part number, location, depot and quantity in it, the third will allow booking in and out. This is in Access 2002 and using VB.
I then have a form with the master table and two sub forms on it to allow adding new parts and booking.
On one of the subforms the user enters a new location for a part already in the master table after using the inbuilt find function via VB code on a button. On the Lost Focus of the Location field I have the code below that sets focus to the location field and then the Qty field. The fields have in their respective Got Focus areas code that puts the depot in from a label that has previously been set, and a default Qty of 1. The curser remains on the Qty field so the user can change to another value if they require.
The problem is after the a new location has been entered and the automatic inputs are put in, when they select the find button to move to the next part number ( to add another location or select existing, in order to go to the other subform) it crashes. The normal Find input box comes up and you type the next part number, but when you select find it crashes. The error either brings up an input box asking for a parameter with the note “DepotListSubform.Form.Part!” then “Method ‘Requery’ of object ‘subform’ failed”
and no matter what you do everything gets closed down. With an obligatory do I want to tell Microsoft box.
I hope I have explained it properly and any suggestions of what I can do would be very welcome.
Additionally is there a book that people would recommend that explains this type of VB code for Access2002 (as I think I’m going to be stuck with this for a while). Please note this will be my own money paying for it.
Thanks
Vsnow42
The code on the Lostfocus of location which is on the subform is :-
If Me.Parent.ActStatus.caption=”Adding Tool” Then
Me!OwnerDepot. Setfocus
Me!Qty.SetFocus
Else
Endif
Again thanks to both dhookom and TheAceMan1 for their help in my last post on the same sort of subject.
I then have a form with the master table and two sub forms on it to allow adding new parts and booking.
On one of the subforms the user enters a new location for a part already in the master table after using the inbuilt find function via VB code on a button. On the Lost Focus of the Location field I have the code below that sets focus to the location field and then the Qty field. The fields have in their respective Got Focus areas code that puts the depot in from a label that has previously been set, and a default Qty of 1. The curser remains on the Qty field so the user can change to another value if they require.
The problem is after the a new location has been entered and the automatic inputs are put in, when they select the find button to move to the next part number ( to add another location or select existing, in order to go to the other subform) it crashes. The normal Find input box comes up and you type the next part number, but when you select find it crashes. The error either brings up an input box asking for a parameter with the note “DepotListSubform.Form.Part!” then “Method ‘Requery’ of object ‘subform’ failed”
and no matter what you do everything gets closed down. With an obligatory do I want to tell Microsoft box.
I hope I have explained it properly and any suggestions of what I can do would be very welcome.
Additionally is there a book that people would recommend that explains this type of VB code for Access2002 (as I think I’m going to be stuck with this for a while). Please note this will be my own money paying for it.
Thanks
Vsnow42
The code on the Lostfocus of location which is on the subform is :-
If Me.Parent.ActStatus.caption=”Adding Tool” Then
Me!OwnerDepot. Setfocus
Me!Qty.SetFocus
Else
Endif
Again thanks to both dhookom and TheAceMan1 for their help in my last post on the same sort of subject.