Need help getting query result back to a form (1 Viewer)

bpd

Registered User.
Local time
Today, 15:19
Joined
Feb 16, 2005
Messages
15
I have a query that has three columns:
[watchstation] [crewmemberID] [%complete]

I have a form that has the same three columns. The first two are combo-boxes and the query is set up to be filtered twice based upon the selection of the first two combo-boxes. So I always get a query result of just one row: watchstationname crewmemberID %complete.

This works very well.

Back to the form. I'd like to have the form automatically read the third column in the query [%complete] and show that result (there will only be one number from 0-100).

I thought that I could reference all three query fields and set the first two column widths to 0, but it won't let me do this with a query, only a table.

I also tried making the third column a subform. This "sort of" works. I select the first two things from comboboxes (which runs my query in the background), but it still doesn't put the %complete into the subform box unless I shift from form view to design view and back to form view - and then it magically appears. If I could just have it appear after I make the first two selections without switching the views, then I'd be in business.

Thanks,
Brian
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 15:19
Joined
Feb 28, 2001
Messages
27,519
If you aren't storing anything with the form, try a DLookup using the data from the two combo boxes. Put some AfterUpdate event code behind each of the combo boxes. Make that code do the DLookup and feed the (obviously unbound) text box.

If this is a straight lookup, you should be able to do the lookup with no trouble other than getting the quotes right in the criteria clause of the DLookup function.
 

Users who are viewing this thread

Top Bottom