Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Openargs cause refs to subform to fail???

Status
Not open for further replies.

TimK01

Technical User
Jan 4, 2002
94
I have a form called Jobs that has 2 subforms appearing in tabs.

The subform is called from 2 places a commabd button and a search screen

When called from a search screen we pass a job number as an open arg and in the form we do
CODE
If Not IsNull(Me.OpenArgs) Then

Dim intJobno As Integer

intJobno = Me.OpenArgs
Me.RecordsetClone.FindFirst "[Job#] = " & intJobno
End If

/CODE


When i open the form with no open args all works fine

When I open the form with an open arg references later in the code to the subforms such as
CODE
Me!Billings.Form.Recalc
/CODE

fail with "You entered an expression that has an invalid reference to the property Form/Report"


This all worked fine under Access97 but has been recently converted.

Can you help explain what is happening?
 
TimK01,
Since [tt]OpenArgs[/tt] is a [tt][navy]String[/navy][/tt] you might try:
[tt]If Me.OpenArgs <> "" Then
...[/tt]

or

[tt]If Len(Me.OpenArgs) > 0 Then
...[/tt]

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top