Can someone help me with the correct code for inserting a value into a specific row or a column in the Database:
So, user clicks button, prompt will say enter a value - enter value - and that value is inserted into the right box within the table.
This is what I have so far:
I know this should work, but my Table has 5 rows, and I want to be able to insert a value into Pass, Merit or Distinction for any of them like so:
Thanks!
So, user clicks button, prompt will say enter a value - enter value - and that value is inserted into the right box within the table.
This is what I have so far:
Code:
Dim MYDB As Database
Dim SOURCE As Recordset
'initialise error handler
On Error GoTo ErrHandler:
'set variables
Set MYDB = CurrentDb()
'create a recordset
Set SOURCE = MYDB.OpenRecordset("Tbl Module_Delivery")
'move to the first record
SOURCE.MoveFirst
'initialise add new record
SOURCE.AddNew
'input values using Input Box to get input
SOURCE![Pass Mark] = InputBox("Please Enter the Required Value")
'update the database with these values
SOURCE.Update
'notify that data was successfully added to database
MsgBox "Data Added!"
ONWARD:
SOURCE.MoveNext
'error handler: exits current action
ErrHandler:
I know this should work, but my Table has 5 rows, and I want to be able to insert a value into Pass, Merit or Distinction for any of them like so:

Thanks!