L
Lynn
OK, I have to say I am not having fun today with passing
parameters and stored procs as record sources.
I have a search form (frmSearch) with a combo box that the
user picks a value from. The combo box is called
cboProjectNumber.
Once the user picks a value another form called
frmBudgetProject opens in which the recordsource is set
through code to a stored procedure. The reason the record
source is set via code is because depending where the form
is opened from determines the record source.
Everything works separately but not together. In other
words, the stored proc works. FrmSearch and
frmBudgetProject work but not together. After I choose a
value from the combo box I get a window asking for the
input parameter. If I manually type in the value the form
opens correctly.
However, I can't get the value from the search form passed
to the stored proc on frmBudgetProject.
Here is what I have so far.
on the on click event on the search form:
stDocName = "frmBudgetProject"
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , "Edit"
On the open and load events on frmBudgetProject:
If Me.OpenArgs = "Edit" Then
Me.RecordSource = "dbo.prB_frm_BudgetProject_Edit"
Me.InputParameters = "@ID = Forms!frmSearch!
cboProjectNumber"
End If
Thanks
parameters and stored procs as record sources.
I have a search form (frmSearch) with a combo box that the
user picks a value from. The combo box is called
cboProjectNumber.
Once the user picks a value another form called
frmBudgetProject opens in which the recordsource is set
through code to a stored procedure. The reason the record
source is set via code is because depending where the form
is opened from determines the record source.
Everything works separately but not together. In other
words, the stored proc works. FrmSearch and
frmBudgetProject work but not together. After I choose a
value from the combo box I get a window asking for the
input parameter. If I manually type in the value the form
opens correctly.
However, I can't get the value from the search form passed
to the stored proc on frmBudgetProject.
Here is what I have so far.
on the on click event on the search form:
stDocName = "frmBudgetProject"
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , "Edit"
On the open and load events on frmBudgetProject:
If Me.OpenArgs = "Edit" Then
Me.RecordSource = "dbo.prB_frm_BudgetProject_Edit"
Me.InputParameters = "@ID = Forms!frmSearch!
cboProjectNumber"
End If
Thanks