G
George Papadopoulos
I have designed a form that inputs technical repair data into a table. I
also have a second form that inputs the spare parts used and stores them in
a corresponding second table. I would like to have a button on the first
form thay pops-up the second form, which would accept as input the spare
parts. I have linked the two tables (second table has a foreign key) and
would like the repair number to be appear in the second form as well as be
stored in the second table. I have used the code below :
Private Sub Add_spare_Click()
On Error GoTo Err_cmdGoHere_Click
Dim stDocName As String
Dim x As Long
Me.[Kwdikos episkeyhs].SetFocus
x = Me.[Kwdikos episkeyhs].Text
stDocName = "STOIXEIA_ANTALLAKTIKWN"
DoCmd.OpenForm stDocName
Me.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec
Me.[Kwdikos episkeyhs].SetFocus
Me.[Kwdikos episkeyhs].Text = x
Exit_cmdGoHere_Click:
Exit Sub
Err_cmdGoHere_Click:
MsgBox Err.Description
Resume Exit_cmdGoHere_Click
End Sub
When I press the button I get the error message : 'This property is
read-only and can`t be set'. I have traced the error back to the code line :
Me.[Kwdikos episkeyhs].Text = x
Why does this assignment fail?
thanks in advance
George Papadopoulos
also have a second form that inputs the spare parts used and stores them in
a corresponding second table. I would like to have a button on the first
form thay pops-up the second form, which would accept as input the spare
parts. I have linked the two tables (second table has a foreign key) and
would like the repair number to be appear in the second form as well as be
stored in the second table. I have used the code below :
Private Sub Add_spare_Click()
On Error GoTo Err_cmdGoHere_Click
Dim stDocName As String
Dim x As Long
Me.[Kwdikos episkeyhs].SetFocus
x = Me.[Kwdikos episkeyhs].Text
stDocName = "STOIXEIA_ANTALLAKTIKWN"
DoCmd.OpenForm stDocName
Me.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec
Me.[Kwdikos episkeyhs].SetFocus
Me.[Kwdikos episkeyhs].Text = x
Exit_cmdGoHere_Click:
Exit Sub
Err_cmdGoHere_Click:
MsgBox Err.Description
Resume Exit_cmdGoHere_Click
End Sub
When I press the button I get the error message : 'This property is
read-only and can`t be set'. I have traced the error back to the code line :
Me.[Kwdikos episkeyhs].Text = x
Why does this assignment fail?
thanks in advance
George Papadopoulos