yes, I would have expected it to work but it does not.
Here is my full code
Code:
Dim DOA As Date DOA = InputBox("Enter the date you want to use for Date of Arrival", "Date of Arrival", "Enter Date of Arrival")
Dim RailcarID As Double
RailcarID = Me.RailcarID
Dim qddate As DAO.QueryDef
Dim rsdate As DAO.Recordset
Set qddate = CurrentDb.QueryDefs("q_TracePlaced_SetDOA")
qddate!Param1 = RailcarID
qddate!Param2 = DOA
qddate.Execute dbFailOnError
The query is like this:
Code:
UPDATE AllRailcarData SET AllRailcarData.CDateOfArrival = [Param2]
WHERE (((AllRailcarData.RailcarID)=[Param1]));
The problem is that the railcarID that gets picked up is the railcarID in the first line of the continuous form. I call this from a button that is in each line of the form.
This is the code just above it in the VBA
Code:
Dim TraceLineId As Double TraceLineId = Me.ID
Dim qd As DAO.QueryDef
Dim rs As DAO.Recordset
Set qd = CurrentDb.QueryDefs("q_TracePlaced_MarkConfirmed")
qd!Param1 = TraceLineId
qd.Execute dbFailOnError
Me.Requery
and it works fine to get the id from that line (Which I call the TraceLineID.
I am not sure why the me.RailcarID is not picking up the id from the current line.