C
Chris Nebinger
Dim strSQL as String
StrSQL = "Select * from [Drawing History Tbl] Where "
strSQL = StrSQL & " [Drawing Number] = '" & Forms![Drawing
Management Frm]![Drawing Number].Value & "' "
strSQL = strSQL & " AND [Drawing Issue] = '" &
Me.Combo2.Value & "'"
'Note, if [Drawing Number] is a number, remove the '
'Same for [Drawing Issue]
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset(strSQL)
'If .EOF, then that record doesn't exist
if rst.EOF then
rst.AddNew
rst("Drawing Number") = Forms![Drawing Management Frm]!
[Drawing Number].Value
rst("Drawing Issue") = Me.Combo2.Value
rst("Associated Project") = Me.Combo4.Value
rst.Update
rst.Close
run button which runs the following code:
recordset with those values to avoid duplicate entries.
Could someone guide me a bit.
StrSQL = "Select * from [Drawing History Tbl] Where "
strSQL = StrSQL & " [Drawing Number] = '" & Forms![Drawing
Management Frm]![Drawing Number].Value & "' "
strSQL = strSQL & " AND [Drawing Issue] = '" &
Me.Combo2.Value & "'"
'Note, if [Drawing Number] is a number, remove the '
'Same for [Drawing Issue]
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset(strSQL)
'If .EOF, then that record doesn't exist
if rst.EOF then
rst.AddNew
rst("Drawing Number") = Forms![Drawing Management Frm]!
[Drawing Number].Value
rst("Drawing Issue") = Me.Combo2.Value
rst("Associated Project") = Me.Combo4.Value
rst.Update
rst.Close
specifies a drawing number and issue and then presses the-----Original Message-----
Hello
I've created a "pop-up" form that load where a user
run button which runs the following code:
Management Frm]![Drawing Number].ValueDim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("Drawing History Tbl")
rst.AddNew
rst("Drawing Number") = Forms![Drawing
that would first verify that there isn't already arst("Drawing Issue") = Me.Combo2.Value
rst("Associated Project") = Me.Combo4.Value
rst.Update
rst.Close
I would like to include this code in an if statement
recordset with those values to avoid duplicate entries.
Could someone guide me a bit.