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

Use option group to go to specific record.

Status
Not open for further replies.

pbrown77

Technical User
Feb 21, 2005
55
US
A form was created that has 1 month per record (with, you guessed it, a total of 12 records)
At the bottom of the form there is an option group named "SelMonth" with 1 - 12 options (Jan - Dec)
Next in code I put:
Dim strwhere As String
Select Case Me.SelMonth
Case 1
strwhere = ([Month] = "January")
Case 2
strwhere = ([Month] = "February")
Case 3
strwhere = ([Month] = "March")
Case 4
strwhere = ([Month] = "April")
Case 5
strwhere = ([Month] = "May")
Case 6
strwhere = ([Month] = "June")
Case 7
strwhere = ([Month] = "July")
Case 8
strwhere = ([Month] = "August")
Case 9
strwhere = ([Month] = "September")
Case 10
strwhere = ([Month] = "October")
Case 11
strwhere = ([Month] = "November")
Case 12
strwhere = ([Month] = "December")
End Select

Here is where I get stuck... How would i use this so that the user selects the month then once they click the "Go" button, it will take them directly to that month?

 
you could use the find method or the filter method or even gotorecord method if the recordset sorted on month number and eliminate the select case all together

DoCmd.GoToRecord acDataForm, "name", acGoTo, Me.SelMonth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top