Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form driven query

Status
Not open for further replies.

KidKeller

Programmer
Joined
Apr 4, 2008
Messages
1
Location
US
I have a form, Form_Add_Record, which contains a date(mm/yy) and position field. When the date is filled in and the user tabs to the position field I want to fill in the position with the the next position for that month (i.e.: records for that date + 1).

I know the statement I need:

SELECT COUNT(*) + 1 AS position FROM alldata
WHERE Alldata!date = date

I just don't know how to get it to execute when I want to.

Any suggestions will be gratefully tested.
 
I think your code will be in the AfterUpdate Event of the Date control on your Form.


You will want set the Position control to the new value.
I don't think you really want the user to Tab to the Date field - for what reason if you have already filled it in?

Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top