Call Form On Given Record

Agent Smith

Registered User.
Local time
Today, 01:26
Joined
Nov 27, 2003
Messages
33
HELLO EVERYONE!

THANKS FOR SOLUTION FOR PRIOR DOUBT.

This one i may need BIG TIME helping hand.

i must say i'm totaly blind on programing.I have a form in table format. i need to place a button to appear on each record (easy) that when clicked opens a form in the record related to the one in tha same table line i pressed the button. confused??

next i present figure jpeg descibing what i want...

Thanks for help given..

Smith:D
 
Agent Smith,

Your new form should be a sub-form to your main form. In
the subform's design view use the Master-Child relationships
and Access will do the work. No need for buttons.

Wayne
 
Jpegs

here are the jpegs presenting what i have

the first one: form2 gives you an idea of what i did using the wisard.

is that suposed to do what i want? notice the options popup window whith the field "estadia numero" related.

the second jpeg: form3 tells you what i intend to do.

if you can shed light into this doubt i whould apppreciate it very much.

thanks everyone :D
 

Attachments

  • form3.jpg
    form3.jpg
    46.2 KB · Views: 143
second jpeg

here is the second image
 

Attachments

  • form3.jpg
    form3.jpg
    46.2 KB · Views: 127
AgentSmith,

I didn't realize that you wanted to bring up another form.

The Command Button can have:

DoCmd.OpenForm "SomeForm",,,"[KeyField] = " & Me.KeyField

Wayne
 
thanks

i thank you for the Precious help( sounded like "Gollum" on )LR.

I will try it now.

have a great 2004 year.

and all Access World Forums Community too of course.

Smith
;)
 
no data

OK. i've done it.

these are the steps i did; follow te correct any mistake i might have done.

1-created the button and followed wizard:
(i programed it to opened the pretended form)
2-selectd it and opened properties panel for it.
3-on the on click event i opened the event and replaced the line that started whith the DoComand.OpenForm for your code line.
4- replaced"SomeForm" whith the name of the form i want to open.
this is the code i end up:
Private Sub Comando24_Click()
On Error GoTo Err_Comando24_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "ESTADIAS"

stLinkCriteria = "[Estadia Nº]=" & Me![Estadia Nº]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Comando24_Click:
Exit Sub

Err_Comando24_Click:
MsgBox Err.Description
Resume Exit_Comando24_Click

End Sub
Private Sub Comando28_Click()
On Error GoTo Err_Comando28_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "ESTADIAS"
DoCmd.OpenForm "ESTADIAS", , , "[KeyField] = " & Me.KeyField


Exit_Comando28_Click:
Exit Sub

Err_Comando28_Click:
MsgBox Err.Description
Resume Exit_Comando28_Click

End Sub

please correct if wrong or place question on doubts.

thanks. Smith
 
Last edited:
AgentSmith,

It looks OK, what happens when you press the button?

Do you get an error, wrong record, no record?

Wayne
 
code ok wayne

Thanks a lot wayne, i got the code working. i forgot i didn't have any records to call.

thanks big time for helping.

have a nice 2004.

greatings

Smith
Portugal.;)
 

Users who are viewing this thread

Back
Top Bottom