I have an MsAccess database with a form with several records as a result of a search. See http://home.c2i.net/wimalie/Alie/SearchForm.gif
The top picture shows the form in normal view, the below one in design view. I have created a commandbutton (visible under nr 2 with the OpenForm sign), which should link to related data in another form (open another form with just the data of the related records).
I have created the button via the command button Wizard which has resulted in the following code:
Private Sub ShowRecord2_Click()
On Error GoTo Err_ShowRecord2_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Tapes"
stLinkCriteria = "[B_Recordnr]=" & Me![Tekst27]
DoCmd.OpenForm stDocName, , , stLinkCriteria
When trying to use the CommandButton I get the error: Invalid use of dot (.), exclamation mark (!) or parantheses.
I have tried to do the same without the Wizard choosen Open form and show all posts, and then the form opens, of course with irrelevant records. My conclusion is that the error must be in the red marked part.
Does this sound familiar to anyone? Suggestions