problems passing OpenAgrs

M

Mark J Kubicki

behind a command button click event, I have this code
(where manufacturer and catalogno are valid fields on the form):
...
Dim strOpenArgs As String
strOpenArgs = "true" & "~" & Me.Manufacturer & "~" & Me.CatalogNo
DoCmd.OpenForm "frmFixtureCatalogueCostHistory", acNormal, ,
"[Manufacturer] = '" & _
Me.Manufacturer & "' AND [CatalogNumber] = '" & Me.CatalogNo & "'",
, , strOpenArgs


behind form: frmFixtureCatalogueCostHistory, I have this code

Private Sub Form_Open(Cancel As Integer)
Dim strOpenArgs As String
strOpenArgs = Me.OpenArgs
MsgBox strOpenArgs
...

however, me.OpenArgs is returned as Null (and the message box does not
open...)

....any suggestions (and thanks in advance),
mark
 
F

fredg

behind a command button click event, I have this code
(where manufacturer and catalogno are valid fields on the form):
...
Dim strOpenArgs As String
strOpenArgs = "true" & "~" & Me.Manufacturer & "~" & Me.CatalogNo
DoCmd.OpenForm "frmFixtureCatalogueCostHistory", acNormal, ,
"[Manufacturer] = '" & _
Me.Manufacturer & "' AND [CatalogNumber] = '" & Me.CatalogNo & "'",
, , strOpenArgs

behind form: frmFixtureCatalogueCostHistory, I have this code

Private Sub Form_Open(Cancel As Integer)
Dim strOpenArgs As String
strOpenArgs = Me.OpenArgs
MsgBox strOpenArgs
...

however, me.OpenArgs is returned as Null (and the message box does not
open...)

...any suggestions (and thanks in advance),
mark

What do you get if you test the string in the first form before
opening the second form form?

Dim strOpenArgs As String
strOpenArgs = "true" & "~" & Me.Manufacturer & "~" & Me.CatalogNo

MsgBox strOpenArgs

' Do you get a message with the correct OpenArgs?

DoCmd.OpenForm "frmFixtureCatalogueCostHistory", acNormal, ,
"[Manufacturer] = '" & _
Me.Manufacturer & "' AND [CatalogNumber] = '" & Me.CatalogNo & "'",
, , strOpenArgs

Note: Your where clause above is written as though both
[Manufacturer] and [CatalogNumber] are Text datatypes. Is that
correct?

Then in the second form you should get the same message.

Private Sub Form_Open(Cancel As Integer)
MsgBox Me.OpenArgs
End Sub
 
M

Mark J Kubicki

when I test the strOpenArgs, after the command button click, it returns the
correct value
however,
when I test strOpenArgs, after the open form (well, the message box just
doesn't display

yes, the manufacturer and catalogno are text


--------------------------------------------------------

fredg said:
behind a command button click event, I have this code
(where manufacturer and catalogno are valid fields on the form):
...
Dim strOpenArgs As String
strOpenArgs = "true" & "~" & Me.Manufacturer & "~" & Me.CatalogNo
DoCmd.OpenForm "frmFixtureCatalogueCostHistory", acNormal, ,
"[Manufacturer] = '" & _
Me.Manufacturer & "' AND [CatalogNumber] = '" & Me.CatalogNo &
"'",
, , strOpenArgs

behind form: frmFixtureCatalogueCostHistory, I have this code

Private Sub Form_Open(Cancel As Integer)
Dim strOpenArgs As String
strOpenArgs = Me.OpenArgs
MsgBox strOpenArgs
...

however, me.OpenArgs is returned as Null (and the message box does not
open...)

...any suggestions (and thanks in advance),
mark

What do you get if you test the string in the first form before
opening the second form form?

Dim strOpenArgs As String
strOpenArgs = "true" & "~" & Me.Manufacturer & "~" & Me.CatalogNo

MsgBox strOpenArgs

' Do you get a message with the correct OpenArgs?

DoCmd.OpenForm "frmFixtureCatalogueCostHistory", acNormal, ,
"[Manufacturer] = '" & _
Me.Manufacturer & "' AND [CatalogNumber] = '" & Me.CatalogNo & "'",
, , strOpenArgs

Note: Your where clause above is written as though both
[Manufacturer] and [CatalogNumber] are Text datatypes. Is that
correct?

Then in the second form you should get the same message.

Private Sub Form_Open(Cancel As Integer)
MsgBox Me.OpenArgs
End Sub
 
M

Mark J Kubicki

when I test the strOpenArgs, after the command button click, it returns the
correct value
however,
when I test strOpenArgs, after the open form (well, the message box just
doesn't display

yes, the manufacturer and catalogno are text


--------------------------------------------------------

fredg said:
behind a command button click event, I have this code
(where manufacturer and catalogno are valid fields on the form):
...
Dim strOpenArgs As String
strOpenArgs = "true" & "~" & Me.Manufacturer & "~" & Me.CatalogNo
DoCmd.OpenForm "frmFixtureCatalogueCostHistory", acNormal, ,
"[Manufacturer] = '" & _
Me.Manufacturer & "' AND [CatalogNumber] = '" & Me.CatalogNo &
"'",
, , strOpenArgs

behind form: frmFixtureCatalogueCostHistory, I have this code

Private Sub Form_Open(Cancel As Integer)
Dim strOpenArgs As String
strOpenArgs = Me.OpenArgs
MsgBox strOpenArgs
...

however, me.OpenArgs is returned as Null (and the message box does not
open...)

...any suggestions (and thanks in advance),
mark

What do you get if you test the string in the first form before
opening the second form form?

Dim strOpenArgs As String
strOpenArgs = "true" & "~" & Me.Manufacturer & "~" & Me.CatalogNo

MsgBox strOpenArgs

' Do you get a message with the correct OpenArgs?

DoCmd.OpenForm "frmFixtureCatalogueCostHistory", acNormal, ,
"[Manufacturer] = '" & _
Me.Manufacturer & "' AND [CatalogNumber] = '" & Me.CatalogNo & "'",
, , strOpenArgs

Note: Your where clause above is written as though both
[Manufacturer] and [CatalogNumber] are Text datatypes. Is that
correct?

Then in the second form you should get the same message.

Private Sub Form_Open(Cancel As Integer)
MsgBox Me.OpenArgs
End Sub
 
M

Mark J Kubicki

when I test the strOpenArgs, after the command button click, it returns the
correct value
however,
when I test strOpenArgs, after the open form (well, the message box just
doesn't display

yes, the manufacturer and catalogno are text
--------------------------------------------------------------------------------------------------------------------------
fredg said:
behind a command button click event, I have this code
(where manufacturer and catalogno are valid fields on the form):
...
Dim strOpenArgs As String
strOpenArgs = "true" & "~" & Me.Manufacturer & "~" & Me.CatalogNo
DoCmd.OpenForm "frmFixtureCatalogueCostHistory", acNormal, ,
"[Manufacturer] = '" & _
Me.Manufacturer & "' AND [CatalogNumber] = '" & Me.CatalogNo &
"'",
, , strOpenArgs

behind form: frmFixtureCatalogueCostHistory, I have this code

Private Sub Form_Open(Cancel As Integer)
Dim strOpenArgs As String
strOpenArgs = Me.OpenArgs
MsgBox strOpenArgs
...

however, me.OpenArgs is returned as Null (and the message box does not
open...)

...any suggestions (and thanks in advance),
mark

What do you get if you test the string in the first form before
opening the second form form?

Dim strOpenArgs As String
strOpenArgs = "true" & "~" & Me.Manufacturer & "~" & Me.CatalogNo

MsgBox strOpenArgs

' Do you get a message with the correct OpenArgs?

DoCmd.OpenForm "frmFixtureCatalogueCostHistory", acNormal, ,
"[Manufacturer] = '" & _
Me.Manufacturer & "' AND [CatalogNumber] = '" & Me.CatalogNo & "'",
, , strOpenArgs

Note: Your where clause above is written as though both
[Manufacturer] and [CatalogNumber] are Text datatypes. Is that
correct?

Then in the second form you should get the same message.

Private Sub Form_Open(Cancel As Integer)
MsgBox Me.OpenArgs
End Sub
 
F

fredg

when I test the strOpenArgs, after the command button click, it returns the
correct value
however,
when I test strOpenArgs, after the open form (well, the message box just
doesn't display

yes, the manufacturer and catalogno are text

--------------------------------------------------------

fredg said:
behind a command button click event, I have this code
(where manufacturer and catalogno are valid fields on the form):
...
Dim strOpenArgs As String
strOpenArgs = "true" & "~" & Me.Manufacturer & "~" & Me.CatalogNo
DoCmd.OpenForm "frmFixtureCatalogueCostHistory", acNormal, ,
"[Manufacturer] = '" & _
Me.Manufacturer & "' AND [CatalogNumber] = '" & Me.CatalogNo &
"'",
, , strOpenArgs

behind form: frmFixtureCatalogueCostHistory, I have this code

Private Sub Form_Open(Cancel As Integer)
Dim strOpenArgs As String
strOpenArgs = Me.OpenArgs
MsgBox strOpenArgs
...

however, me.OpenArgs is returned as Null (and the message box does not
open...)

...any suggestions (and thanks in advance),
mark

What do you get if you test the string in the first form before
opening the second form form?

Dim strOpenArgs As String
strOpenArgs = "true" & "~" & Me.Manufacturer & "~" & Me.CatalogNo

MsgBox strOpenArgs

' Do you get a message with the correct OpenArgs?

DoCmd.OpenForm "frmFixtureCatalogueCostHistory", acNormal, ,
"[Manufacturer] = '" & _
Me.Manufacturer & "' AND [CatalogNumber] = '" & Me.CatalogNo & "'",
, , strOpenArgs

Note: Your where clause above is written as though both
[Manufacturer] and [CatalogNumber] are Text datatypes. Is that
correct?

Then in the second form you should get the same message.

Private Sub Form_Open(Cancel As Integer)
MsgBox Me.OpenArgs
End Sub

Are you sure the second form is opening from closed or is it
displaying from not visible?
What happens if you place the code to read the openargs in the second
form's Load event instead of it's Open event?

Private Sub Form_Load()
MsgBox Me.OpenArgs
End Sub
 
M

Mark J Kubicki

<helps if you are adding the code to the right form -oh brother... -sorry
for the trouble>
mark


fredg said:
when I test the strOpenArgs, after the command button click, it returns
the
correct value
however,
when I test strOpenArgs, after the open form (well, the message box just
doesn't display

yes, the manufacturer and catalogno are text

--------------------------------------------------------

fredg said:
On Sun, 18 Feb 2007 18:56:40 -0500, Mark J Kubicki wrote:

behind a command button click event, I have this code
(where manufacturer and catalogno are valid fields on the form):
...
Dim strOpenArgs As String
strOpenArgs = "true" & "~" & Me.Manufacturer & "~" & Me.CatalogNo
DoCmd.OpenForm "frmFixtureCatalogueCostHistory", acNormal, ,
"[Manufacturer] = '" & _
Me.Manufacturer & "' AND [CatalogNumber] = '" & Me.CatalogNo &
"'",
, , strOpenArgs

behind form: frmFixtureCatalogueCostHistory, I have this code

Private Sub Form_Open(Cancel As Integer)
Dim strOpenArgs As String
strOpenArgs = Me.OpenArgs
MsgBox strOpenArgs
...

however, me.OpenArgs is returned as Null (and the message box does not
open...)

...any suggestions (and thanks in advance),
mark

What do you get if you test the string in the first form before
opening the second form form?

Dim strOpenArgs As String
strOpenArgs = "true" & "~" & Me.Manufacturer & "~" & Me.CatalogNo

MsgBox strOpenArgs

' Do you get a message with the correct OpenArgs?

DoCmd.OpenForm "frmFixtureCatalogueCostHistory", acNormal, ,
"[Manufacturer] = '" & _
Me.Manufacturer & "' AND [CatalogNumber] = '" & Me.CatalogNo & "'",
, , strOpenArgs

Note: Your where clause above is written as though both
[Manufacturer] and [CatalogNumber] are Text datatypes. Is that
correct?

Then in the second form you should get the same message.

Private Sub Form_Open(Cancel As Integer)
MsgBox Me.OpenArgs
End Sub

Are you sure the second form is opening from closed or is it
displaying from not visible?
What happens if you place the code to read the openargs in the second
form's Load event instead of it's Open event?

Private Sub Form_Load()
MsgBox Me.OpenArgs
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top