SQL in combo box click code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use three combo boxes to enter three pieces of information
needed to make a query. The query (SQL language tested and ok) returns a
single record from the table "tblTimeCardList", which is the underlying
control for the form.

Ultimate goal is to use the query to set the form to the unique record
corresponding to the data in three combo boxes.

I read and tried follow advice (RunSQL question) from Trydrannoy (7/28/2005
2:19PM PST) to Judy, regards using a combo box to run a "select" query from
the form "frmTimeInput".

I put the SQL string into an "on click" event in the combo box. Code approx:

Private Sub cmdFindTimeSheet_click ()
dim strSQL as string
strSQL = " ... the sql string exactly as tested ..."
mycombobox.rowsource = strsql
mycombobox.requery
end sub

The combo box returns a blank.

Two questions:
1) am I doing something wrong?
2) is there better way?

regards,
slowuptake
 
The code provided was kinda like a "template" that you need to modify to
include your combo box name, sql string etc. If you are filling out an
employment application and there is a box or line:
____________________________
(your full name)
You would not write "your full name" on the line. You would write "Slow Up
Take" or whatever.

You haven't provided us with any information about your form's record source
sql or your combo box names. These would be the pieces of information that
would "fill in the blanks".
 
Back
Top