B
babyatx13 via AccessMonster.com
I am trying to pass a value to an unbound combo box in a different database.
Example
Working in DB1 I open DB2 and FormA, in FormA I have a unbound combo box
(cboprojectselect ) that looks up the same set of ProNo’s found in DB1. I
want this unbound combo box to show the ProNo that was found in DB1. Can
anyone tell me how this can be done in DB1 code?
Code in DB1:
Private Sub Schedule_Click()
Dim xPath
Dim xTemp
Dim xApp As Application
Dim xProno
Set xApp = CreateObject("Access.Application")
xProno = Me.Projectno
xTemp = “T:\â€
xPath = xTemp & "DB2.accdb"
xApp.OpenCurrentDatabase xPath, , True
xApp.DoCmd.OpenForm "FormA"
End Sub
This works fine I just need the next step.
Where cboprojectselect = xProno
I tried :
Forms!frm_daterangeenter!cboprojectselect = xProno
xApp.DoCmd.OpenForm "FormA", , ,“cboprojectselect = xPronoâ€
xApp.DoCmd.OpenForm "FormA", , ,cboprojectselect = xProno
xApp.DoCmd.OpenForm "FormA",acNormal,,cboprojectselect = xProno
xApp.DoCmd.OpenForm "frm_daterangeenter", acNormal, , cboprojectselect =
xProno, acFormEdit
xApp.DoCmd.OpenForm "frm_daterangeenter", acNormal, , cboprojectselect =
xProno, acFormAdd
And other variations of the above and nothing worked.
Any HELP would be appreciated.
Thanks
K Board
Example
Working in DB1 I open DB2 and FormA, in FormA I have a unbound combo box
(cboprojectselect ) that looks up the same set of ProNo’s found in DB1. I
want this unbound combo box to show the ProNo that was found in DB1. Can
anyone tell me how this can be done in DB1 code?
Code in DB1:
Private Sub Schedule_Click()
Dim xPath
Dim xTemp
Dim xApp As Application
Dim xProno
Set xApp = CreateObject("Access.Application")
xProno = Me.Projectno
xTemp = “T:\â€
xPath = xTemp & "DB2.accdb"
xApp.OpenCurrentDatabase xPath, , True
xApp.DoCmd.OpenForm "FormA"
End Sub
This works fine I just need the next step.
Where cboprojectselect = xProno
I tried :
Forms!frm_daterangeenter!cboprojectselect = xProno
xApp.DoCmd.OpenForm "FormA", , ,“cboprojectselect = xPronoâ€
xApp.DoCmd.OpenForm "FormA", , ,cboprojectselect = xProno
xApp.DoCmd.OpenForm "FormA",acNormal,,cboprojectselect = xProno
xApp.DoCmd.OpenForm "frm_daterangeenter", acNormal, , cboprojectselect =
xProno, acFormEdit
xApp.DoCmd.OpenForm "frm_daterangeenter", acNormal, , cboprojectselect =
xProno, acFormAdd
And other variations of the above and nothing worked.
Any HELP would be appreciated.
Thanks
K Board