Sorry about that it was suppose to be this:
Private Sub Form_Open()
commaOne = InStr(Me.OpenArgs, ",")
commaTwo = InStr(Mid(Me.OpenArgs, commaOne + 1), ",") + commaOne
commaThree = InStr(Mid(Me.OpenArgs, commaTwo + 1), ",") + commaTwo
ConfigName = Left(Me.OpenArgs, commaOne - 1)
SiteID = Mid(Me.OpenArgs, commaOne + 1, (commaTwo - 1) - commaOne)
UMTS_ID = Mid(Me.OpenArgs, commaTwo + 1, (commaThree - 1) - commaTwo)
projName = Mid(Me.OpenArgs, commaThree + 1)
If Not IsNull(Me.OpenArgs) Then
Me.txtUMTS_ID = UMTS_ID
Me.Caption = ConfigName & " Configuration for " & SiteID
Me.PgTechnology.Caption = Me.OpenArgs & " Antenna System
Configuration" 'ConfigName & " Antenna System Configuration"
Me.txtProjectName = projName
End If
End Sub
:
I think I can see the problem. You are currently opening frmSiteConfiguration
yet in the frmSiteConfiguration On Open event you are trying to open it again:
--
Bob Larson
Access World Forums Administrator
Tutorials at
http://www.btabdevelopment.com
__________________________________
:
THE CLICK EVENT OF THE BUTTON
Private Sub cmdConfig_850GSM_Click()
Me.Visible = False
DoCmd.OpenForm "frmSiteConfiguration", acNormal, OpenArgs:="GSM850"
& "," & Me.txtSiteID & "," & Me.txtProjectName
End Sub
THE OPEN EVENT OF THE FORM
Private Sub Form_Open(Cancel As Integer)
commaOne = InStr(Me.OpenArgs, ",")
commaTwo = InStr(Mid(Me.OpenArgs, commaOne + 1), ",") + commaOne
commaThree = InStr(Mid(Me.OpenArgs, commaTwo + 1), ",") + commaTwo
ConfigName = Left(Me.OpenArgs, commaOne - 1)
SiteID = Mid(Me.OpenArgs, commaOne + 1, (commaTwo - 1) - commaOne)
UMTS_ID = Mid(Me.OpenArgs, commaTwo + 1, (commaThree - 1) -
commaTwo)
projName = Mid(Me.OpenArgs, commaThree + 1)
If Not IsNull(Me.OpenArgs) Then
Me.txtUMTS_ID = UMTS_ID
Me.Caption = ConfigName & " Configuration for " & SiteID
Me.PgTechnology.Caption = Me.OpenArgs & " Antenna System
Configuration" 'ConfigName & " Antenna System Configuration"
Me.txtProjectName = projName
DoCmd.OpenForm "frmSiteConfiguration", acNormal, "qry_Combined",
"tbl_SiteInformation.SiteID ='" & SiteID & '"'" & " And
[Config_Technology]='" & ConfigName & "'" & " And
[tbl_SiteInformation.ProjectName]='" & projName & "'"
End If
End Sub
:
I posted this in your other post of the same question -
What code are you using in the open event of the form you are passing the
OpenArgs to? That actually may be the culprit.
--
Bob Larson
Access World Forums Administrator
Tutorials at
http://www.btabdevelopment.com
__________________________________
:
Thank you very much Bonnie.
:
I see. Yes you can open it filtered to the first form. It's very late and
I'm tired but I'll look at some of my apps and get back tomorrow.
Bonnie
http://www.dataplus-svc.com
:
1.) The problem is not the fact that the argument is "Me.txtSiteID", even
when I used a string like "GSM850" I still get the same problem.
2.) The reason I am using the openArgs is because I am trying to enter a new
record that is linked to the record on the opening form. Filter won't work in
this case because there will be no record to open to.
:
Sorry, I am not that familiar with using it like that. I see in the help
that you can refer to that OpenArgs in code or an event after opeing the form
but I would filter it as I open the form by putting the argument into the
Filter property of the Data tab of the form. Not sure but maybe that's got
something to do with your problem.
Bonnie
http://www.dataplus-svc.com
:
txtSiteID is a contol on the siteInfo form and it is being used as a openargs
argument.
DoCmd.OpenForm "frmSiteConfiguration_Input", acNormal, , , acFormEdit,
acWindowNormal, OpenArgs:=Me.txtSiteID
:
Sorry Ayo - I might be missing something but what does it mean? I'm assuming
there is a control somewhere named txtSiteId but what are you doing with it?
If you want to filter on that control what must it equal?
Bonnie
http://www.dataplus-svc.com
:
That is the OpenArgs.
:
Hi Ayo,
What is the Me.txtSiteID argument?
Bonnie
http://www.dataplus-svc.com
:
I am having a very perculiar problem. I have two forms. A siteInfo form and a
SiteConfig form. I have a button on the siteInfo form that I am suppose to
use to open the siteConfig form.
The problem I am having is when I click the button on siteInfo to open
siteConfig using something like this:
DoCmd.OpenForm "frmSiteConfiguration_Input", acNormal, , , acFormEdit,
acWindowNormal, Me.txtSiteID,
If I have an Open Event in siteConfig I get a "The OpenForm action was
canceled" but if there is no open event in siteConfig, the form opens but
with all the wrong data.
Any ideas what is going on?