This is what I have and it is working fine.
Call DoCmd.OpenForm("Invoice by Dates")
Forms![Invoice by Dates]![txtSingleDate] = Me.txtSingleDate
Forms![Invoice by Dates]![txtBeginDateRange] = Me.txtStartDate
Forms![Invoice by Dates]![txtEndDateRange] = Me.txtEndDate
Forms![Invoice by Dates]![logic_Value] = Me.cmbLogical
Forms![Invoice by Dates]![txtVendor] = Me.cmbVendor
Forms![Invoice by Dates]![txtReviewer] = Me.cmbReviewer
The problem now is in the Load Event of the other form. This one is not
working as I expected it to. It suppose to disable any control that don't
have a value but it just disables every thing. Any ideas?
Thank.
Ayo
Private Sub Form_Load()
If IsNull(Me.txtVendor.Value) Then
Me.txtVendor.Enabled = False
End If
If IsNull(Me.txtReviewer.Value) Then
Me.txtReviewer.Enabled = False
End If
If IsNull(Me.txtBeginDateRange.Value) Then
Me.txtBeginDateRange.Enabled = False
'Me.lblSDR.Enabled = False
End If
If IsNull(Me.txtEndDateRange.Value) Then
Me.txtEndDateRange.Enabled = False
'Me.lblEDR.Enabled = False
End If
If IsNull(Me.txtSingleDate.Value) Then
Me.txtSingleDate.Enabled = False
'me.lblSingleDate.Enabled = False
End If
End Sub
John W. Vinson said:
Sorry about that. What I meant to write was:
Call DoCmd.OpenForm("Form2")
Again: no Call is needed. DoCmd is a statement in its own right; you don't
"Call" it, just put
DoCmd.OpenForm("Form2").
Forms![Form2]![txtBox1]=Me("txtBox1")
Forms![Form2]![txtBox2]=Me("txtBox2")
Forms![Form2]![txtBox3]=Me("txtBox3")
Forms![Form2]![txtBox4]=Me("txtBox4")
The proper syntax would be
Forms![Form2]![txtBox4]=Me!txtBox4
though the parenthesis notation might be acceptable.
I want to use it for multiple entries
Well... you almost surely DON'T.
The only reason I can think of to do this is to copy data from Form1's
Recordsource into another table (Form2's Recordsource), storing a redundant
duplicate copy of the data.
It's almost never a good idea to do so; and - if you DO need to do so - it's
much better not to get Forms involved at all, but instead run an Append query
to append one or more records from the first table directly into the second
table.
What's the purpose of this exercise? What are you trying to accomplish?
John W. Vinson [MVP]