Hello,
Having trouble with the following:
I have a function "OpenFormEdit" that opens different forms, that gets called from different places.
Now i am trying to open a new "frmAddNewStockAssemblies"form in 'edit' mode and pass a link criteria to it and having trouble doing so.
here is the function:
this code opens my form but those not link it to the right data...
this is what i use to open the form (callthe function)
can this be done,
Thanks,
Having trouble with the following:
I have a function "OpenFormEdit" that opens different forms, that gets called from different places.
Now i am trying to open a new "frmAddNewStockAssemblies"form in 'edit' mode and pass a link criteria to it and having trouble doing so.
here is the function:
Code:
Public Function OpenFormEdit(frmName As String)
Dim frm As Form
Dim stLinkCriteria As String
DoCmd.OpenForm frmName, , , stLinkCriteria, acFormEdit
DoEvents
Set frm = Forms(frmName)
If frmName = "frmJobs" Then
' MsgBox "edit Mode" 'debug
frm.JobNumber.SetFocus
DoCmd.RunCommand acCmdFind
frm.cmdNew.Visible = False
frm.Text179.Value = 1
frm.Label95.Caption = "Search Form"
frm.CustomerType.Locked = True
DoCmd.GoToRecord , , acFirst
If frm.Text179 = 1 Then frm.cmdCancel.Enabled = True
ElseIf frmName = "frmAddNewInventory" Then
frm.Caption = "View Inventory"
MsgBox "Inventory in Edit Mode", , "Debug Pop-up"
[b] ElseIf frmName = "frmAddNewStockAssemblies" Then 'will use later
[COLOR=blue] stLinkCriteria = "[groupID]= " & Forms![frmPurchaseOrders]![frmTabs].Form![frmStockAssemblies].Form![groupID] & "'" [/color]
frm.txtSupplier.SetFocus
frm.cboSupplier.Visible = False [/b]
ElseIf frmName = "FormY" Then
'Setup for FormY
frm.TextboxName.Value = 101
End If
Set frm = Nothing
End Function
this is what i use to open the form (callthe function)
Code:
Call OpenFormEdit(stDocName)
can this be done,
Thanks,