U
Underpaidadmin
I have an unbound form that I want users to enter information then hit the
update/append command button, if two particular controls match what is
already in the table I'd like the form to prompt the user to overwrite the
record with the information on the form. If there is no matching record I
want it to append the record to the table without further user intervention.
Searching around I found the following code snippet that seems to be on the
right track but I can't make it work for me:
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("Directions")
rs.MoveFirst
Do While Not rs.EOF
rs.Edit 'does not like this why?
rs!Dir = UCase(rs!Dir)
rs.Update
rs.MoveNext
Loop
rs.Close
Is this the right idea or can a query update/append/and search.
update/append command button, if two particular controls match what is
already in the table I'd like the form to prompt the user to overwrite the
record with the information on the form. If there is no matching record I
want it to append the record to the table without further user intervention.
Searching around I found the following code snippet that seems to be on the
right track but I can't make it work for me:
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("Directions")
rs.MoveFirst
Do While Not rs.EOF
rs.Edit 'does not like this why?
rs!Dir = UCase(rs!Dir)
rs.Update
rs.MoveNext
Loop
rs.Close
Is this the right idea or can a query update/append/and search.