Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Requery when any record\field on datasheet view form is viewed 1

Status
Not open for further replies.

micang

Technical User
Aug 9, 2006
626
US
MS Access 2003

Hi All,

I have a form in datasheet view. What I would like is that when any field in the record is viewed, to run a requery.

I can get it to work if I put the requery command in each fields event(got focus), but then I would have to go and put this command in each of the fields on the form. Is it at all possible to have it that when any field in the record, on the form is viewed\got focus, can run the requery command?

Any info in the correct direction will be appreciated.

Thank you.

Michael
 
I can not imagine why you would want or need to do this. But if you have to, you can look at this faq702-6904. This will allow every control react to the same event without writing event procedures for each control.
 
Hi Majp

Thank you for the link.

I know, it's not ideal, but I have a datasheet view form that data get's updated in, reason being that the user has to see a history/list of records to make a decion on what to update, so I am not to sure how to go about displaying this, without datasheet view.

Thank you for the assistance, it's appreciated.

Michael
 
I get the datasheet, I do not get the need to requery on every field, or requery at all. Maybe take a look at the forms oncurrent event. Maybe that is what you are looking for.
 
Hi MajP,

The thing that I sort of need this to work like this is that when a user views a record, I need it to requery a subform. The only way I have managed this is to use the got focus event for each field in the record. Ideally I would like it that when the user is viewing any field in the record, that record triggers the requery, but when he/she views another record, then it must requery. I can't get to trigger the even when a record is viewed.

I did try the oncurrent event, but it does nto seem to work (does nothing), but maybe I am doing somethign wrong, as that does sound logical.

Thank you for your time.

Michael


 
It sounds like the on current event should work for you. Make sure that it is firing, make sure [event procedure] is in the event property. You can stick a msgbox in the procedure to test the event is working.
 
Hi MajP,

The on current is now working, not sure why all of a sudden, but it's working.

Thank you for your help and confirming that the on current even should indeed work.

Appreciate it.

Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top