command button and form

tubar

Registered User.
Local time
Today, 13:15
Joined
Jul 13, 2006
Messages
190
this will sound easy....i want to create a command button that opens a specific record in a form....how do i accomplish that.
 
Hi tubar,

just quickly.

Create a query that will open the record and then include this query for the form record.

Robert88
 
More Help

That Would Be 118 Queries And 118 Forms. What I Need To Do Is Find A Way When I Press A Command Button That It Opens One Form At Record 100....when I Press Another Command Button It Opens The Same Form But Record 50....and So On
 
Hi tubar,

A few questions.

How many of these forms are required simultaneously?
What governs the record number required?

Look forward to some answers before proceeding to solution.

Robert88
 
Robert88 said:
Hi tubar,

A few questions.

How many of these forms are required simultaneously?


1



What governs the record number required?
not sure how to answer sorry. i want to create 118 command buttons...command button 1= form 1 record 1
command button 2= form 1 record 2
command button 3= form 1 record 3
and so on.
 
Hi tubar,

What about one text box which requests the record number and one button to open the form required? I just used a query to search the text field before the button is clicked. So in the Button number field just type a number between 1 - 118 and you will get your result?

Check the attached.

Hope it helps, if something different is needed try posting another message? :p

Robert88
 

Attachments

what im making is a gui.
i have a picture
and on top of that transperent buttons
a user selects a room in the house and the form with the room info on it pops up.
 
Hi tubar,

Could always try this for every button. Check the attached file, watch out for the invisible field........ The attached file only has two buttons, going to take a while to code all 118 buttons. Wish you all the best with that one.:D

Code:
Private Sub CmdOpenForm1_Click()
On Error GoTo Err_CmdOpenForm1_Click

    Dim stDocName As String
    Dim stLinkCriteria As String
    
    'The Field txtOpenFormNumber is set to visible = no
    Me![txtOpenFormNumber] = 1

    stDocName = "frmFormNumber"
    
    stLinkCriteria = "[Record Number]=" & Me![txtOpenFormNumber]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_CmdOpenForm1_Click:
    Exit Sub

Err_CmdOpenForm1_Click:
    MsgBox Err.Description
    Resume Exit_CmdOpenForm1_Click
    
End Sub

I Hope this works for you? :p

Robert88
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom