Tark221
Registered User.
- Local time
- Today, 23:56
- Joined
- Oct 12, 2012
- Messages
- 74
Hi there,
I have the following code below which will update any of the fields in a recordset.
I havent wrote the rest just because I know it's fine. The issue I'm having is with the line in orange which is used to identify which record needs updating. If I simply write 2 in the code it will find that Absence ID. If I try to use a control instead say a textbox1.value it doesn't work. The strange thing is when I run line by line the textbox1.value will show the number 2 but it still won't accept it. Is there a difference between simply writing the number 2 and using a control which is storing the value 2 in.
Thanks for any help
I have the following code below which will update any of the fields in a recordset.
Code:
Dim dbsHelpdesk as DAO.Database
Dim rstAbsence as DAO.Recordset
Set dbsHelpdesk = currentdb
Set rstAbsence = dbsHelpdesk.openrecordset("Absence")
rstAbsence.MoveFirst
Do until rstAbsence.EOF
[COLOR="Orange"]If rstAbsence!AbsenceID = 2 Then[/COLOR]
rstAbsence.Edit
I havent wrote the rest just because I know it's fine. The issue I'm having is with the line in orange which is used to identify which record needs updating. If I simply write 2 in the code it will find that Absence ID. If I try to use a control instead say a textbox1.value it doesn't work. The strange thing is when I run line by line the textbox1.value will show the number 2 but it still won't accept it. Is there a difference between simply writing the number 2 and using a control which is storing the value 2 in.
Thanks for any help