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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem setting Property Sheet values for a Form using VBA

Status
Not open for further replies.

Ranvier

Programmer
Jun 17, 2004
73
GB
Hello,

I have a problem with setting Property Sheet values for a Form using VBA code. I am trying to set the following properties:

.RecordSource
.InputParameters
.UniqueTable

I am setting this in an ADP and for a couple of my users my code works without any problem, and for other users it errors because it cannot set the properties in the form.

My code which works:

With Me.sfrmppepCGL_1_HeadsOfCover.Form
.RecordSource = "dbo.procHeadsOfCoverByPolicyLineIDTypeGet"
.InputParameters = "@lngPolicyLineID int =" & Nz(Me.txtPolicyLineID, 0) & ", @lngPolicyLineTypeID int = " & gclngPL_CGL
.UniqueTable = "dbo.tblHeadsOfCover"
End With

The error message I get when using the above code is:

Run-time error 2101
The setting you entered isn't valid for this property

Incidently, if i set the parameters using a different method it actually works (not using WITH / END WITH):

Me.sfrmppepCGL_1_HeadsOfCover.Form.RecordSource = "procHeadsOfCoverByPolicyLineIDTypeGet"
Me.sfrmppepCGL_1_HeadsOfCover.Form.UniqueTable = "tblHeadsOfCover"
Me.sfrmppepCGL_1_HeadsOfCover.Form.InputParameters = "@lngPolicyLineID int =" & Nz(Me.txtPolicyLineID, 0) & ", @lngPolicyLineTypeID int = " & gclngPL_CGL

I can't understand why this would be the case - is there any library references that I should check that i have not referenced?

Suggestions and help is greatly appreciated as I just can't work this one out.

Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top