D
Douglas J. Steele
Do you mean that the parameter prompt box is asking for Me.CboSchemeID?
Is that the name of the combo box on your form, or did you perhaps mistype
it?
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Is that the name of the combo box on your form, or did you perhaps mistype
it?
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Angel_1 said:Ok, thanks to you both, i think i'm nearly there now.
It now says enter Parameter value with the name of the selected scheme. :-(
Douglas J. Steele said:As Steve pointed out yesterday, since you've got a space in the field name,
you need to enclose it in square brackets:
Private Sub CboSchemeID_AfterUpdate()
Me.RecordSource = "SELECT * FROM " & _
"QryCompanyFormDetails WHERE " & _
"[Scheme ID] = " & Me.CboSchemeID
End Sub
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
theAngel_1 said:Hi Douglas,
I tried what u suggested and i get a Run time error 3705, Syntax error
(missing operator) in query expression 'Scheme ID = Office'
:
Steve's statement was intended to be typed on a single line, but word-wrap
makes it difficult to see that sometimes.
I've split the statement into shorter lines, with concatenation characters
are the end of each line.
The first two lines in the routine should end & _ (that's ampersand, space,
underscore),
Private Sub CboSchemeID_AfterUpdate()
Me.RecordSource = "SELECT * FROM " & _
"QryCompanyFormDetails WHERE " & _
"Scheme ID = " & Me.CboSchemeID
End Sub
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Hi Steve,
I copy and pasted what you wrote but access automatically added
extracorrect"
I have tried everything, drivin me nuts now. (Scheme ID is
withwrapthe
space)
thanks alot
Private Sub CboSchemeID_AfterUpdate()
Me.RecordSource = "SELECT * FROM QryCompanyFormDetails"
WHERE
Scheme ID = " & Me.CboSchemeID"
End Sub
:
Angel,
This shouls all be in one line....
Me.RecordSource = "SELECT * FROM QryCompanyFormDetails WHERE
SchemeID=" & Me.cboSchemeID
It occurs to me that your newsreader may be putting in a line
andyou have copied that to your code?
If not, please copy/paste the code from your VBE into your reply here,
let's have a look.
--
Steve Schapel, Microsoft Access MVP
Angel_1 wrote:
Hi
I really appreciate your help, but i still cant get it to work.
I get an error message saying Compile Error, Sub or funciton not
defined.
WHERE is highlighted on the VB Editor Window.