I am confused.

raychoy2k

Registered User.
Local time
Today, 05:20
Joined
Feb 24, 2003
Messages
29
I have a form called "client contact" with a subform called invoice.

I am using VBA to run a filter to find specific contacts. When I run the below command:

stDocName = "Client Contact"

stLinkCriteria = "[Phone]=" & "'" & Me![Text0] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

A stupid InputBox pops up ( I don't know where from) asking me to "Enter a Parameter Value for Invoices subform.invoice"

Why does this popup appear and where in the world is it coming from? I know I did not add this in.
 
Change the following:

stLinkCriteria = "[Phone]=" & "'" & Me![Text0] & "'"

to

stLinkCriteria = "[Phone] = '" & me![Text0] & "'"

Should help..

HTH
 
jfgambit gave you a practical suggestion. I'll give you the theoretical explanation.

When you run a query and get a "Enter parameter..." input box, almost invariably you have incorrectly spelled the name of one of your data fields. The incorrect spelling is the name of the variable being requested in the input box.

Solution: Find and correct the fields names that are misspelled.

Secondary possibility: You spelled the name right but put it in a context where it could not be recognized.

Solution: Examine the syntax of the thing you are running to verify the names and their usage.
 
Hey Doc...I'm a practical kind o' guy!
:D

Doc has given you information beneficial to helping you understand the problem in the future.
 
The delimeters were correct for the original. However the one JF suggested was just shorter.

But, the problem still persists. I think it is because I am applying a filter to the main form, but the subform requires some kind of filter criteria too, in order to open properly. But even when I enter nothing (blank/null) in the input box, the subform displays properly. If I press cancel, then no subform shows up.

Oh, I am even more confused now. I only a newbie. I wish access would take it easy on me.
 
Can you post the code and the Filter code for the subform?

Or can you post a zipped copy of the database? It might be something small that is being overlooked.
 
Here she is:

Private Sub Command3_Click()
On Error GoTo Err_Command3_Click

Dim stDocName As String
Dim stFilter As String
Dim stLinkCriteria As String

stDocName = "Client Contact"

stLinkCriteria = "[Phone]='" & Me![Text0] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria


Exit_Command3_Click:
Exit Sub

Err_Command3_Click:
MsgBox Err.description
Resume Exit_Command3_Click

End Sub


This command button is on a little form with a text box. I enter a phone number to math on the "Client Contact" form to filter it out. The "Client Contact" form has a "invoice" subform. For some reason, after I press this command button, a input box appears asking me to enter a parameter value for "Invoices subform.invoice"

Hopefully somebody can figure this out.
 
Sorry Pat,

I don't really know what you mean. It is not a query or anything, so I don't see where an order by would come into the picture.
 
But the Form opens fine when I open it by itself.

I will check your suggestions.
 
You were right Pat!! Thats pretty good!

It was an orderby property in the subform. I don't know how you knew. Can you explain why that happens?
 

Users who are viewing this thread

Back
Top Bottom