PDA

View Full Version : Looking up a Value and Writing Text in a Column for this Record



afzalw
01-25-2017, 03:47 PM
I have this code which is for creating a new record in a existing table.

I am looking for a code that would actually look for the record that has that particular Number (InventoryNumber) and write CHECK in the last column for that particular Record.

Basically, I want to keep track of all the Records that I have already gone through. I am going through these records in a form by clicking a button and this code will be in there with the entire code for the button.

Thanks


Dim InventoryNumber As String

InventoryNumber = Me.Text17

Set rstDatabase = CurrentDb

Set rstTable= _
rstDatabase.OpenRecordset("TableName", dbOpenDynaset)


With rstTable
.AddNew

!IMAGEID = InventoryNumber
!Station = Me.TextBoxChainage.Value

End With

Nwtech75
01-27-2017, 12:32 AM
Can you rephrase the question. I don't think I understand exactly what it is that you are trying to do. In your table, are you using a Text Data type or a Boolean. I would suggest that you use a Boolean, that way you can just change the value of the Boolean when you are done checking the record, you can also run a qry to find those records where the value of the Boolean is zero.