Filter record by month and year!?

nescartel

Registered User.
Local time
Tomorrow, 00:59
Joined
Feb 3, 2005
Messages
26
hello everyone,

i need serious help here. (pliz view the attached image). i am building a form that is used everyday to enter data. bcoz of this, there will be loads of data, so i want the form to view the data monthly and yearly, so that users can view data they want on that particular month of the year. i have made a combobox for months where user will select the month they want to view, and when user selected the months, the subform should view records corresponding to that month. and when user inserts year in the textbox, the previous data will be narrowed down to the specific month AND year. it's kinda like query in query here. to be honest i am not good with queries, so if possible can anyone point out what i should do here? thanx for the considerations... oh, and i also plan to put a command button that will pop up a new form that will view statistics for that particular month, eg: average, max data, etc...
 

Attachments

  • swperf.JPG
    swperf.JPG
    71.3 KB · Views: 267
Think first.
On you combo box after update event.
set a recordset as an object, then use the findfirst and bookmark methods.
 
erm, i'm sorry, but i can't seem to understand what ur telling me... i'm kinda new here actually :o can u please break it down for me?
 
just put this code in your after update event

dim rs as object
set rs=me.recordsetclone
rs.findfirst "YourID=" & str(me.yourComboBox.column(x))
me.bookmark=rs.bookmark
 
i put the code in "afterupdate" event of my combo box, i changed 'mycombobox' in your code to my combobox's name. but when it is run, there are debug errors. hmm... is there anything i should change? thanx in advance... i am really bad at this... :(
 
Your combobox should have a recordsource with an ID field related to the ID field in your subform. This is the field name you put where there is "YourID".
"yourComboBox" should be the name of your combobox and "x", is the column number of "yourID" field.

it should reflect this. and hope this will help!!!!

private sub MyComboBox_AfterUpdate()
dim rs as object
set rs= me.recordsetclone
rs.findfirst="MyID=" str(me.MyComboBox.column(0))
me.bookmark=rs.bookmark
End sub
 
Last edited:
i'm sorry to bother u again skea,
but i can't seem to get anything right here.
thanx anyway... :confused:
 

Users who are viewing this thread

Back
Top Bottom