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

Asking for parameter values - why?

Status
Not open for further replies.

mattpearcey

Technical User
Mar 7, 2001
302
GB
I have set up a subform, which i am currently having problems with (another story!), that i thin kis casuing the database to ask for me to enter parameter values for the two fields in the subform - everytime i open the database main form. Get my problem? Basically - i open the database and it asks for these parameter values! Why is this happening, what does it mean, and how do i get rid of it?

Thank you in advance

Matt Pearcey
 
Is the message either something like
The Query requires at least 1 parameter. or similar?
This would be a problem of the form query fields not all being correct.

Do you recognise the parameter it's asking for?

Often it's easy to get the master/child link field names (in the subform properties) around the wrong way, or spelt slightly wrong.

Also could be caused by the fact that some subform events happen BEFORE the parent form events (eg Form_Open and Form_Load from memory) so if the subform needs things in the Form_Load from the main form they won't be there yet.

Ben
+61 403 395 052
 
Thanks Ben, buti am still having problems. let me give you some more info. I have one main form, that holds infomration on banks. I have anohter fomr set up called a comments form, that enables me to put commetns against each of these banks. i have a button that opens this form, but everytim i click on it, it states: ' Compile error. Only comments must appearafter end sub, end function or end property.' it then points to the follwoing code :

Private Sub open_comments_form_Click()
On Error GoTo Err_open_comments_form_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Comments"

stLinkCriteria = "[Bank Id]=" & Me![Bank Id]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_open_comments_form_Click:
Exit Sub

Err_open_comments_form_Click:
MsgBox Err.Description
Resume Exit_open_comments_form_Click

End Sub

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Comments"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_open_comments_form_Click:
Exit Sub

Err_open_comments_form_Click:
MsgBox Err.Description
Resume Exit_open_comments_form_Click

End Sub

It highlights dimstdoc name (above)

what do i do? i have tried to reset it, but the same errors come up.

Help?

Thanks in advance

Matt
 
Private Sub open_comments_form_Click()
On Error GoTo Err_open_comments_form_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Comments"
stLinkCriteria = "[Bank Id]=" & Me![Bank Id]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_open_comments_form_Click:
Exit Sub
Err_open_comments_form_Click:
MsgBox Err.Description
Resume Exit_open_comments_form_Click
End Sub


This I believe should be the whole function.
It appears you've pasted most of the function again under it, but without the function declaration line.
Try replacing all your code above with just this.
Ben
+61 403 395 052
 
It worked!!

One of my problems solved! I think you were right as looking through it, it appeared as if was in there twice.

Many thanks Ben, and keep you eye out for all my other queries i post!

Thank

Matt
 
Ben - me again. Ive been searching for this thread everywhere. I have another parameter problem. I have just made some changes to my database to include some more fields, and also to adjust some originals. Howver, now, the main field is BankName (which i havent touched) is messing about. Everytime i now enter the database it asks me to 'Enter Paramter value. Bank Name' Is this because i have maybe delted the space between the Bank and Name?

All the otehr data that i have changed field for, seams to be ok. Its just this bankname field.

Help? Thank you for your help already.

Matt Pearcey
 
If you created a form, report, or query using names that have since been changed, you will need to change the names in the form, report or query. Otherwise, Access will have to ask you for a value whenever you open an object with old spelling because it doesn't know where to find that identifier. Terry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top