G
George Papadopoulos
Greetings everybody
I am building a database based on Microsoft Access. The database stores
'Technician report sheets info'. I have these two tables, the first stores
information about 'technician visit' such as technician code, serviced
company name, e.t.c. The second table stores various 'spare parts' used in
the repairing. This table has a foreign key named 'technician visit code'
which is unique for every visit of a technician and relates the above
forementioned tables.
Correspondingly, there are two forms for these tables. I need to have a
button on the first form (techician visit) such that when it is pressed, the
second form opens but the foreign key of the second table (spare parts)
takes the value of 'technician visit code' from the first form.
I have used the below code :
Private Sub Add_spare_Click()
On Error GoTo Err_cmdGoHere_Click
Dim stDocName As String
stDocName = "STOIXEIA_ANTALLAKTIKWN"
DoCmd.OpenForm stDocName
[Forms].stDocName.[Visit Code].SetFocus
[Forms].stDocName.[Visit Code].Code = Me.[Visit Code].Code
Exit_cmdGoHere_Click:
Exit Sub
Err_cmdGoHere_Click:
MsgBox Err.Description
Resume Exit_cmdGoHere_Click
End Sub
for the button event handler. When I press the button though, I get the
error 'Object doesn`t support the property or method'.
Am I missing something?
I am building a database based on Microsoft Access. The database stores
'Technician report sheets info'. I have these two tables, the first stores
information about 'technician visit' such as technician code, serviced
company name, e.t.c. The second table stores various 'spare parts' used in
the repairing. This table has a foreign key named 'technician visit code'
which is unique for every visit of a technician and relates the above
forementioned tables.
Correspondingly, there are two forms for these tables. I need to have a
button on the first form (techician visit) such that when it is pressed, the
second form opens but the foreign key of the second table (spare parts)
takes the value of 'technician visit code' from the first form.
I have used the below code :
Private Sub Add_spare_Click()
On Error GoTo Err_cmdGoHere_Click
Dim stDocName As String
stDocName = "STOIXEIA_ANTALLAKTIKWN"
DoCmd.OpenForm stDocName
[Forms].stDocName.[Visit Code].SetFocus
[Forms].stDocName.[Visit Code].Code = Me.[Visit Code].Code
Exit_cmdGoHere_Click:
Exit Sub
Err_cmdGoHere_Click:
MsgBox Err.Description
Resume Exit_cmdGoHere_Click
End Sub
for the button event handler. When I press the button though, I get the
error 'Object doesn`t support the property or method'.
Am I missing something?