A
ArielZusya
I've got a table (tblMain) with the following (relevant) fields:
tblMain
.FirstName
.LastName
.Seat
.RefNum
I've got a form that has a graphical display of the seats to which the
people listed in tblMain are assigned. I'd like to put a text box on each
seat corresponding to first and last name of the person assigned to that seat
(stored in tblMain.Seat). The same database is used for various seatings so
I'd like only those associated with the RefNum at hand to be called. I can
write a simple enough query which I can call from VBA and which relies on
atext box on the form that holds the refNum (txtRefNum) to accomplish this:
stSQLHolder = "SELECT tblMain.FirstName, tblMain.LastName, tblMain.Seat,
tblMain.RefNum FROM tblMain WHERE (((tblMain.Seat)=1") AND
((tblMain.RefNum)='" & Me.txtRefNum & "'));"
But I just don't know how to make use of this once I've done it. If it was
a combo box I would tell it to set RowSource to this query... but I don't
think I can do that with Control Source, right? So... I imagine there's an
expression I can write for the Control Source but I'm still unclear how to
rewrite queries as expressions. Is that how to proceed? If so, how do I do
that? If not, what should I do instead? Thanks!
tblMain
.FirstName
.LastName
.Seat
.RefNum
I've got a form that has a graphical display of the seats to which the
people listed in tblMain are assigned. I'd like to put a text box on each
seat corresponding to first and last name of the person assigned to that seat
(stored in tblMain.Seat). The same database is used for various seatings so
I'd like only those associated with the RefNum at hand to be called. I can
write a simple enough query which I can call from VBA and which relies on
atext box on the form that holds the refNum (txtRefNum) to accomplish this:
stSQLHolder = "SELECT tblMain.FirstName, tblMain.LastName, tblMain.Seat,
tblMain.RefNum FROM tblMain WHERE (((tblMain.Seat)=1") AND
((tblMain.RefNum)='" & Me.txtRefNum & "'));"
But I just don't know how to make use of this once I've done it. If it was
a combo box I would tell it to set RowSource to this query... but I don't
think I can do that with Control Source, right? So... I imagine there's an
expression I can write for the Control Source but I'm still unclear how to
rewrite queries as expressions. Is that how to proceed? If so, how do I do
that? If not, what should I do instead? Thanks!