Row Source using SQL to an unlined table

sambrierley

Registered User.
Local time
Yesterday, 22:16
Joined
Apr 24, 2014
Messages
56
Hi all,

thanks for any help on this.

i have a form which contains a combobox.
i used the query builder inside the combox box to build the row source which looks like the attached.
what the query does is bring out the matching WSL for all Requirements.ID.

is there a way so that the query uses the requirement actually loaded on the form as the source?
 

Attachments

  • Capture.PNG
    Capture.PNG
    6.7 KB · Views: 96
Good morning,

I am not entirely sure what it is you want to do, but if you want to use a value on a loaded form, you would use this syntax I n the query grid:

Forms!yourFrmName!ControlOnForm

Give it a try...
 
Assuming your sql is the rowsource (and not a query) just refer to the control on the form by it's name and surround with square brackets e.g.

[txtRequirements]

It won't run in the query builder without prompting for a value, but will run fine in the form unprompted.

Whichever solution you go for, you will probably need some code to requery it if txtRequirements changes. To do this put

cboRequirementList.requery

in the txtRequirements control after update event

change names to suit
 

Users who are viewing this thread

Back
Top Bottom