Can't refresh a textbox that DLookUp's the result of a query (1 Viewer)

Colin@Toyota

What's an Access?
Local time
Today, 18:34
Joined
May 2, 2006
Messages
203
Might be a slightly confusing title, so I appologize for that... But hopefully it was confusing enough to get some people to take a look at my problem! :rolleyes:

To start, I have a table with 7 fields; six of which are attributes, the seventh being a unique number assigned to each unique combination of attributes. Now I have a form with an option group for one of the attributes, and the rest are combo boxes that are all unbound. A query with criteria set to each of the controls on the form allows users to decipher the unique number based on each combination of attributes. Fine. I have it set up so that the unique number displays in a textbox near the bottom of the form. It is correct the first time I set the attribute combinations, but if I change any of them, the textbox is not updated with the new (and correct) unique number.

The textbox uses a dlookup function to source the number from the query.

I have tried .requery, .repaintobject, etc in the textbox and form properties in several places (on current, afterupdate, on click, etc.) all to no avail.

Any help or suggestions would be reaaaaaally appreciated.

I am sure it is something fairly simple, and a year ago I probably wouldn't have needed to post a question. But unfortunately, I am quite rusty, as I havent used Access for anything but simple queries for at least the last 12 months...

Cheers,

Colin
 

Colin@Toyota

What's an Access?
Local time
Today, 18:34
Joined
May 2, 2006
Messages
203
I have found a way to force the requery using a command button and me.txtAPX.requery... which is ok...

I would rather have it update automatically though... I appreciate any help.

Cheers!
 

Colin@Toyota

What's an Access?
Local time
Today, 18:34
Joined
May 2, 2006
Messages
203
UPDATE:

I have found some ways to automate it... but they are fudged at best.

First I tried the OnMouseMove event... and that seemed to work ok with the option buttons, but would only update the number when changes were made to a combo box when either another combo box was selected, or one of the option buttons.

I have also tried the Timer event... this works perfectly set on an interval of 1000... except that the text flashes every second! This becomes annoying after a short while.

I have also tried the following events without success: DataChange, DataSetChange, BeforeUpdate, AfterUpdate, etc. I am pretty much trying it with every event until something works...

Thanks...
 

Colin@Toyota

What's an Access?
Local time
Today, 18:34
Joined
May 2, 2006
Messages
203
I figured it out... I just went into each control on the form and set the on change and lostfocus properties to me.txtAPX.requery and it works perfectly.

Thanks anyways for any one who thought about it...
 

Users who are viewing this thread

Top Bottom