Change Report Data Source From Form

  • Thread starter Thread starter 123
  • Start date Start date
1

123

Thank You For Your help and answer:
Is There any way to change report Record Source from Command button in A
Form in Run Time
Thank You
 
If I understand you correctly:
You can base your report on a query where the query picks its criteria up
from fields in an open form.

EX:
In the criteria of the query you can enter something like:

Forms!Formname!Fieldname.value
This of couse would require that your form be open and would give a blank
result if the formfield is empty.

HTH
Terry
 
You might try attaching this to the buttons click event

Private Sub Command33_Click(
If Me.Dirty Then 'Save the record first
Me.Dirty = Fals
End I
Me.RecordSource = "tblP2
End Su

to change to table two. If you have multiple tables, try multiple buttons, each one identified as a different table.
 
Back
Top