Wizard - Button - Open Form - not working

douglasrac

Registered User.
Local time
Today, 04:00
Joined
Feb 15, 2011
Messages
13
I'm trying to create a button that will open a form in a specific record, but
it doesn't work

See the screenshots with the steps I made:

1. Selecting the action of the button
img148.imageshack.us/img148/9770/1openform.jpg

2. Choosing the option to open in a specific record
img511.imageshack.us/img511/6655/2specific.jpg

3. The problem
img200.imageshack.us/img200/6452/3error.jpg

4. Proof that the tables are related and have common fields
img638.imageshack.us/img638/5599/relacionamento.jpg

For some reason is not working and I can't figure out. Was working, I have
another button that open another form in the same way and it's working. Now,
even if I copy and paste the code of the other button and change the parts
that are necessary, it doesn't work.
 
Strange :confused: at any rate the code you are looking for should look like;
Code:
Private Sub Command14_Click()
On Error GoTo Err_Command14_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "FRM_YOurFormNameHere"
    
    stLinkCriteria = "[LinkFieldInTable]=" & Me![LinkFieldOnForm]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command14_Click:
    Exit Sub

Err_Command14_Click:
    MsgBox Err.Description
    Resume Exit_Command14_Click
    
End Sub
 
Last edited:
See the screenshots with the steps I made:

1. Selecting the action of the button
img148.imageshack.us/img148/9770/1openform.jpg

2. Choosing the option to open in a specific record
img511.imageshack.us/img511/6655/2specific.jpg

3. The problem
img200.imageshack.us/img200/6452/3error.jpg

4. Proof that the tables are related and have common fields
img638.imageshack.us/img638/5599/relacionamento.jpg

For future reference, please upload images to the forum here directly as many of us, me included, have the public image sharing sites blocked by their workplace and can't see them. Here are instructions on how to upload to this forum.
 
Seems that my problem is exactly this one:

access programmers co uk/forums/showthread.php?t=197754[/url]

And the solution is to bound the fields.

[...]the form with the unbound controls filled in will be blank.[...]

How can I bound fields? Where is this? Sorry, but I don't know what it means and how to check if its bound or unbound.
 
For future reference, please upload images to the forum here directly as many of us, me included, have the public image sharing sites blocked by their workplace and can't see them. [CANT POST LINKS]Here are instructions[/URL] on how to upload to this forum.

For future reference, maybe the rules of the forum should change.
I can't post URLs or Images because I don't have 10 posts. So, it makes hard to explain my problem.
Hope you guys can understand the link I tried to show.
 
For future reference, maybe the rules of the forum should change.
I can't post URLs or Images because I don't have 10 posts. So, it makes hard to explain my problem.
Hope you guys can understand the link I tried to show.

For future reference, you don't need to be able to post a URL simply upload your images with your post using the paper-clip icon at the top of the posting window.
 

Users who are viewing this thread

Back
Top Bottom