problems with 'cbo's and requery


Joined
Jan 27, 2014
Messages
4
Reaction score
0
I have a form that I am using to add records of work orders. I am trying to set up 2 combo boxes one that has the accounts and the other has the members of each account. I need the second box to only show the members of the specified account. I have done this with a query. With no other coding the query appears to work it is showing just the members of one account. I have tried:

me.objectname.requery
and
docmd.requery(objectname)

I had both of these as an event for After update on the Account combo box.

When I use docmd.requery I get a runtime error 2109 whenever I change the Account box.

When I use me.obj.requery I recieve a compile error method of data member not found that points to the .requery section of the code.

I am sure this is an easy fix and I apologize for what seems to be a newb question but I have not used Access in at least 10 years and even then I wasn't that great with it. Any help on what I am doing wrong or just a code that would do this for me would be greatly appreciated. For reference the names for my objects are simply;

Account - the combo box for the account
Requestor - the combo box containing the members
Add_Record - the name of the form.
 
Ad

Advertisements

Joined
Jan 27, 2014
Messages
4
Reaction score
0
After reading a bit more on the forum I tried using

Private Sub AccountAfterUpdate()
Forms!Add_Record.Requestor.Requery
End Sub

This does not give me an error but it doesn't requery either. I read that pressing F9 refreshes the form and that did work to update my Requestor box based on what was in the Account box but I would rather not require everyone to have to press F9 every time they change the Account.
 
Ad

Advertisements

Joined
Jan 27, 2014
Messages
4
Reaction score
0
I believe I was able to solve my problem. Not sure why .requery wouldn't work but I changed to using

private sub Account_LostFocus()
me.refresh
end sub

and it works the way I want it to.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Cbo Update Problems 5
Requery problem 6
Requery Problem 5
requery problem 1
REQUERY Problem? 2
Requery Problem! 0
Requery Problems 6
CBO List 1

Top