R
rik
I am trying to build an Access 2002/2003 database application that I
would like to offer to other writers so they can track submissions.
Just trying to make a helpful tool for writers, poets, or anyone who
submits anything to anywhere, actually... I'm having trouble with the
Visual Basic code for the on click event of a button.
So, I have a form, FormA, whose source is a query. On FormA, there is
a numeric field called FieldA. FieldA corresponds to the primary key
(numeric) of the source table for FormB. On FormB, that same related
field is called FieldB.
I have a button on FormA called ButtonA. When clicked, ButtonA should
open FormB to the record in FormB where FieldB is the same as the
value of FieldA on the record where ButtonA was clicked.
The code that is not working is:
_________________________________________________
Private Sub ButtonA_Click()
CoCmd.OpenForm "FormB",,, FormB.FieldB = FormA.FieldA
End Sub
__________________________________________________
With this, I get Run-time error '424'. Object Required.
I read that "the WhereCondition is just an sql where statement without
the WHERE", but apparently, there is some other syntax or structure I
am missing. Any help greatly appreciated. Thanks!
would like to offer to other writers so they can track submissions.
Just trying to make a helpful tool for writers, poets, or anyone who
submits anything to anywhere, actually... I'm having trouble with the
Visual Basic code for the on click event of a button.
So, I have a form, FormA, whose source is a query. On FormA, there is
a numeric field called FieldA. FieldA corresponds to the primary key
(numeric) of the source table for FormB. On FormB, that same related
field is called FieldB.
I have a button on FormA called ButtonA. When clicked, ButtonA should
open FormB to the record in FormB where FieldB is the same as the
value of FieldA on the record where ButtonA was clicked.
The code that is not working is:
_________________________________________________
Private Sub ButtonA_Click()
CoCmd.OpenForm "FormB",,, FormB.FieldB = FormA.FieldA
End Sub
__________________________________________________
With this, I get Run-time error '424'. Object Required.
I read that "the WhereCondition is just an sql where statement without
the WHERE", but apparently, there is some other syntax or structure I
am missing. Any help greatly appreciated. Thanks!