A openrecordset question

A

Aldred

Hi,
I have codes like these:
Private Sub Submit_Click()

Dim dbs As Database
Dim qdf As QueryDef
Set dbs = CurrentDb()
Set qdf = dbs.CreateQueryDef(CheckPartNum, "Select PartNum from PartNum
where PartNum='" & PNum1 & "'")
Set rst = dbs.OpenRecordset("PartNum")
If Not rst.EOF Then
MsgBox ("Found")
Else
MsgBox ("Not Found")

End If
End Sub

My codes are to find out if a part number is already in the table. PartNum
is the table. How could I get the select statement executed?

Thanks.



--
 

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