Form Query Using Form Data

  • Thread starter Thread starter The Boondock Saint
  • Start date Start date
T

The Boondock Saint

I have a form which has a field called id this will change depending on the
record being viewed...

what id like to be able to do is have a drop down list.. which draws data
from another table..... but id like to be able to use that id value as one
of the conditions...

is there a way i can add that value into the expression?

Look forward to any ideas you might have
 
Saint,

There are many circumstances where you can reference the value of a
control on the current record of an open form. If you mean that the Row
Source of the combobox should be selected according to the value of the
id control on your form, then this is simply a matter of putting the
equivalent of this...
[Forms]![NameOfYourForm]![id]
.... in the criteria of the id column in the query that serves as the
combobox's Row Source.

If this isn't what you mean, maybe you could post back with some more
explicit details, and examples of what you want.
 
Thanks Steve...
Ive got it working but... when i change the record.. to the next one... it
doesnt update the data in the box....
is there a way to make it do it when the record is opened?

Steve Schapel said:
Saint,

There are many circumstances where you can reference the value of a
control on the current record of an open form. If you mean that the Row
Source of the combobox should be selected according to the value of the id
control on your form, then this is simply a matter of putting the
equivalent of this...
[Forms]![NameOfYourForm]![id]
... in the criteria of the id column in the query that serves as the
combobox's Row Source.

If this isn't what you mean, maybe you could post back with some more
explicit details, and examples of what you want.

--
Steve Schapel, Microsoft Access MVP

I have a form which has a field called id this will change depending on
the record being viewed...

what id like to be able to do is have a drop down list.. which draws data
from another table..... but id like to be able to use that id value as
one of the conditions...

is there a way i can add that value into the expression?

Look forward to any ideas you might have
 
Ive got it working... using the requery feature

Me![listboxname].Requery

Ive attached it to a button.. but is there a way i can set it so that it
does it when the form page loads... with the new record?


Steve Schapel said:
Saint,

There are many circumstances where you can reference the value of a
control on the current record of an open form. If you mean that the Row
Source of the combobox should be selected according to the value of the id
control on your form, then this is simply a matter of putting the
equivalent of this...
[Forms]![NameOfYourForm]![id]
... in the criteria of the id column in the query that serves as the
combobox's Row Source.

If this isn't what you mean, maybe you could post back with some more
explicit details, and examples of what you want.

--
Steve Schapel, Microsoft Access MVP

I have a form which has a field called id this will change depending on
the record being viewed...

what id like to be able to do is have a drop down list.. which draws data
from another table..... but id like to be able to use that id value as
one of the conditions...

is there a way i can add that value into the expression?

Look forward to any ideas you might have
 
Saint,

Is the combobox on the same form and the "change the record"? If so, on
the Current event of the form, you could put code like this...
Me.NameOfCombobox.Requery

If not, please be merciful and give some more detailed description.
 
Thanks Steve
Its working perfectly now
Thanks very much for your help.
 

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

Back
Top