Use of SQL Select statements in combo boxes

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

Guest

When I use the form to add a record to the table the following statement works properly for the first record.. but on the next record it will pull up identical date as in the first. If you close the form and open it again it works fine

SELECT FULLPOWR.AGEN
FROM FULLPOW
WHERE (((FULLPOWR.POWER)=[forms]![Data Input Form - Estreat].[POWER]))

Any suggestions will be appreciated

Sam
 
Samuel Foster said:
When I use the form to add a record to the table the following
statement works properly for the first record.. but on the next
record it will pull up identical date as in the first. If you close
the form and open it again it works fine.

SELECT FULLPOWR.AGENT
FROM FULLPOWR
WHERE (((FULLPOWR.POWER)=[forms]![Data Input Form -
Estreat].[POWER]));

Any suggestions will be appreciated.

Sam

You must requery the combo box in the form's Current event. Use an
event procedure similar to the following:

Private Sub Form_Current()

Me.YourComboName.Requery

End Sub
 
Back
Top