How to transfer data from one form to another

rexb

Registered User.
Local time
Today, 15:40
Joined
Oct 29, 2008
Messages
129
I've a database that when opened would display any work that is pending or in progress. what I want to do is when the user click any record it will open a new form and go to that specific record.
 
You could you something like the following in the on click event of a button, in fact this was produced by the built in button wizard.

Code:
    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "FRM_YourFormName" [COLOR="Green"]'The name of the form to be opened[/COLOR]
    
    stLinkCriteria = "[CommmonLinkID]=" & "'" & Me![CommmonLinkID] & "'"  [COLOR="Green"]'Replace the item between the square brackets with the name of the filed that is common to the two form on which you can link[/COLOR]
    DoCmd.OpenForm stDocName, , , stLinkCriteria
 
Is it possible to just click any of the fields and then it will open another form?I've attached the first form (attachment) where the user will choose and the form (attachment2) that it's suppose to open after choosing from the fields.
 

Attachments

  • attachement.JPG
    attachement.JPG
    98 KB · Views: 145
  • attachement2.JPG
    attachement2.JPG
    54.9 KB · Views: 143
Yes, just put that code in the Form's On Click event. You can find this event by putting your form in design view, then click in the small above the vertical ruler and to the left of the horizontal ruler. A small black square will appear within this area, indicating that you are now dealing with the Form's propeties as a whole rather than the properties of a single control.

Whenever a user clicks on the record selector, to the left of the current record, this will cause your second form to open.
 

Users who are viewing this thread

Back
Top Bottom