Find record from dialog, if no match then new record

D

DeDBlanK

Private Sub cmdFindAdd_Click()
Dim strSQL As String
Dim dtmDate As Date
Dim lngLine As Long
Dim lngShift As Long
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim blnFound As Boolean
Dim fldItem As DAO.Field

'Set bolean to false, used for verfying if record is found
blnFound = False
'If any criteria is missing end Sub
If Me.cmbDate = "" Or Me.cmbLine = "" Or Me.cmbShift = "" Then
Exit Sub
Set db = CurrentDb()

Set rs = New DAO.Recordset
Set strSQL = "SELECT * FROM tblProductionDate WHERE lngLineId = "
& Me.cmbLine & ", lngShift = " & Me.cmbShift & ", dtmDate = " &
Me.cmbDate & ";"
rs.OpenRecordset strSQL

With rstStoreItems
While Not .EOF
For Each fldItme In .Fields
'Not quite sure where to go from here

Forms to place criteria if new record:
lngProductionDateId.long, dtmDate.Date/time, lngLine.long,
lngShift.long

If anyone knows how I can accomplish this or has a better idea, I
would greatly appreciate it.
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