Furstrated!!! Help.

A

Ayo

This was working fine before, now all of a sudden I am getting " Data type
mismatch in criteria expression" error and I can't figure this out anymore. I
am getting very furstrated. I don't know what to do anymore.

Private Sub cmbProjectNumber_AfterUpdate()
cmbProjectName.RowSource = "SELECT DISTINCT [Project Name] FROM [InScope
Table] WHERE [Project Number]='" & Me.cmbProjectNumber.Value & "'"""
cmbProjectName = Null
cmbProjectName.Requery

cmbTaskNumber.RowSource = "SELECT DISTINCT [Task Number] FROM [InScope
Table] WHERE [Project Number]='" & Me.cmbProjectNumber.Value & "'"
cmbTaskNumber = Null
cmbTaskNumber.Requery

cmbNationalSiteID.RowSource = "SELECT DISTINCT [National Site ID] FROM
[InScope Table] WHERE [Project Number]='" & Me.cmbProjectNumber.Value & "'"
cmbNationalSiteID = Null
cmbNationalSiteID.Requery
End Sub
 
B

Beetle

What is the data type of [Project Number]? You are using quote delimiters as
if it were a text data type. Is that the case?

BTW - It appears that you are selecting a project number in the first combo,
and then limiting the subsequent combos to only *one* value based on the
project number. If so, then why do you need the other three combo boxes?. Why
not just use text boxes? Maybe I'm wrong - just a thought.
 
J

Jeanette Cunningham

Table] WHERE [Project Number]='" & Me.cmbProjectNumber.Value & "'""
there is an extra double quote after .Value & "'""
should be:
..Value & "'"

Jeanette Cunningham
 
A

Ayo

Thanks guys. I figured it out.

Jeanette Cunningham said:
Table] WHERE [Project Number]='" & Me.cmbProjectNumber.Value & "'""
there is an extra double quote after .Value & "'""
should be:
..Value & "'"

Jeanette Cunningham

Ayo said:
This was working fine before, now all of a sudden I am getting " Data type
mismatch in criteria expression" error and I can't figure this out
anymore. I
am getting very furstrated. I don't know what to do anymore.

Private Sub cmbProjectNumber_AfterUpdate()
cmbProjectName.RowSource = "SELECT DISTINCT [Project Name] FROM
[InScope
Table] WHERE [Project Number]='" & Me.cmbProjectNumber.Value & "'"""
cmbProjectName = Null
cmbProjectName.Requery

cmbTaskNumber.RowSource = "SELECT DISTINCT [Task Number] FROM [InScope
Table] WHERE [Project Number]='" & Me.cmbProjectNumber.Value & "'"
cmbTaskNumber = Null
cmbTaskNumber.Requery

cmbNationalSiteID.RowSource = "SELECT DISTINCT [National Site ID] FROM
[InScope Table] WHERE [Project Number]='" & Me.cmbProjectNumber.Value &
"'"
cmbNationalSiteID = Null
cmbNationalSiteID.Requery
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top