As a newbie, I have what might be a beginners problem
I have created a form to interrogate our database and display all records without a unique building reference code OSAPR. The form has two subforms which hold details of domestic and occupational addresses and OSAPR codes. Only one subform should be displayed at any one time.
The idea is that when a new record number (primary key called holding_id) is on the form, a bit of code runs which looks at the txttype to determine whether it is a D (domestic address) or O (occupational address).
The two subforms are set as visible = no, so they only become visible under the above circumstances.
I then have a matched and an unmatched button to update the table behind the form.
I have tried various codes to sort out the two subforms, currently I have:
Private Sub txtHolding_id_GotFocus()
If Me.txtType = D Then
Me.dbo_OSAddress_subformD.Visible = True
If Me.txtType = O Then
Me.dbo_OSAddress_subformO.Visible = True
however not only is the domestic subform visible at all times, regardless of the txttype code being D or O, but I also get an error message :
"Compile error: Method or data member not found"
Please advise - what am I doing wrong?