Your references to cboRes and cboType must be outside of the quotes.
mySQL = mySQL & " WHERE (([Resource]='" & Me.[cboRes] & "')"
mySQL = mySQL & " AND ([Type]=" & Me.[cboType] & "))"
Look at the difference in what I put there: I've assumed that Resource is a
text field, while Type is a numeric field. Exagerated for clarity, that's
mySQL = mySQL & " WHERE (([Resource]=' " & Me.[cboRes] & " ' )"
mySQL = mySQL & " AND ([Type]=" & Me.[cboType] & "))"
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"Brian Hoffman" <(E-Mail Removed)> wrote in message
news:7198D4CB-44BA-4977-87CB-(E-Mail Removed)...
> If Len(cboType) > 0 Then
>
> Dim cnn1 As ADODB.Connection
> Set cnn1 = CurrentProject.Connection
> Dim rst1 As New ADODB.Recordset
> rst1.ActiveConnection = cnn1
>
> Dim mySQL As String
> mySQL = "SELECT [PKResType#] FROM tblResTypes"
> mySQL = mySQL + " WHERE (([Resource]='Me.[cboRes]')"
> mySQL = mySQL + " AND ([Type]='Me.[cboType]'))"
>
> rst1.Open mySQL
> rst1.MoveFirst
>
> I am fairly new to programming, so I have taken alot of my work directly
> from textbooks. Can anyone explain why BOF and EOF are true here?