I use "ThisRecord" as a parameter to tell a sub "UpdateRecords" how to update a table.
The code likes below. But I get error "ByRef argument type mismatch" on "ThisRecord".
Code:
Dim ThisRecord As String
Private Sub Form_Open(Cancel As Integer)
ThisRecord="A"
.....
End Sub
Private Sub Button_Click()
Call UpdateRecords(ThisRecord,...)
End Sub
Private Sub UpdateRecords(TxType As String, ...)
...
End Sub
However, I add a temp variable str in Button_Click as below, then it works.
Code:
Private Sub Button_Click()
Dim str as String
str=ThisRecord
Call UpdateRecords(str,...)
End Sub