Use of SQL Select statements in combo boxes

S

Samuel Foster

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
 
D

Dirk Goldgar

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
 

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

Top