Change table on form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is if possible to put a button on a form that would change the table the
current form answers to?
 
I know I can change it in the design of the form manually. How can I do that
with a button? Can you show me an example?

Thanks.
 
Private Sub MyButton_Click()

Me.RecordSource = "SELECT Field1, Field2, Field3 FROM Table1"

End Sub
 
The assumption is that if you change the record source of the
form/subform the "names" of the fields in the two sources must be
identical for all of the fields showing on the form/subform.


Ron
 
Definitely.

To be honest, I find the idea that a form can be used with different tables
a little suspect: it makes me think that the tables are properly normalized.
I suppose, though, that there could be legitimate reasons.
 
Back
Top