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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing a form's text box value to a table field

Status
Not open for further replies.

dnelson24

IS-IT--Management
Apr 1, 2002
59
0
0
US
I have a form with 2 text boxes in it, one displaying the year(2006) the other displaying the month(June). I also have a table that gets appended after the user runs an update on that table. Thus last month the last record would have a field YEAR (2006) and MONTH(May). They run the data for the current month and it appends this table so that the last record now shows as 2006 and June. How can I have a button on my form check to see if the current year/month record already exists in my "appending" table?

form name = Fiscal_Calendar
year text box =text22
month text box =text24
append table = yeartable

So basically how can I compare a text box field on a form to a field in a table?
thanks
Dave
 
The month, I think, can be obtained from:

[tt]DlookUp("MonthFieldName","yeartable","[ID]=" & DMax("[ID]","yeartable")[/tt]

Assuming that the ID field is numeric.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top