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

Change recordsource

Status
Not open for further replies.

jake7363

Technical User
May 31, 2006
56
Hi,
I have two tables: tblJan, tblFeb

I have 1 form: frmMonth.

I am trying to use a command button to change the recordsource to view another month. Here is what I have:

Sub cmdFeb_Click()
Forms!frmMonth.RecordSource = "tblFeb"
End Sub

An error message appears as follows:

"Run-time error '3251':
Operation is not supported for this type of object"


If this doesn't work, how can I get the recordsource to change to Feb?

Thanks in advance,
Jake
 
How are ya jake7363 . . .

No reason why that shouldn't work. Try:
Code:
[blue]   Me.RecordSource = "tblFeb"[/blue]
If that doesn't work instantiate a new blank form (don't add any objects). Set the RowSource to [blue]tblJan[/blue]. Instantiate the button and see if you get the same results . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
I don't know why this works and the other way doesn't, but THANKS!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top