form navigation

channi

New member
Local time
Today, 11:20
Joined
Jul 27, 2003
Messages
5
I have discovered that I am a member of this forum. My last question is years ago. I haven't made much progress. However, I am using a msaccess db for subscription management of a magazine.
I have designed the db from scratch and it does its job to some degree. It is very unelegant, as I have to do much myself that I wish the db would do for me.

I have created a form for the table 'invoices'. I would like to be able to double click on the 'customer id' belonging to a certain invoice, with the result that the form belonging to the table 'subscribers' opens at that same subscriber the customer id belongs to.

I have created a macro that opens the form 'subscribers', but how do I tell it to open that certain subscriber.

I have taught myself access, and always found in the helpfile an answer which led further. Not in this case. I imagine this is a very simple, often used procedure.

I have a similar issue when writing invoices. On the form 'subscribers' there is a button that opens another form 'new invoice'. I would like it to display automatically the subscriber from where I opened the form 'new invoice'. At the moment I have to enter the user id again manually.

Do you know what I mean? Is there an easy answer to this question. Where could I find information about this kind of linking forms together?
 
Not an expert by far and am not sure in what control you are trying to open the new form, but i use:

Code:
Private Sub LstFindings_DblClick(Cancel As Integer)

Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmPartDetail"
    
        
    DoCmd.OpenForm stDocName, , , , acForm
    
    stLinkCriteria = "[PartID]=" & Me![LstFindings]
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    
    

End Sub

You can replace the "LstFindings_DblClick" with your button and a single click like "Command2_Click"

Then change "frmPartDetail" to your forms name (The one to open)

And "LstFindings" to the name of your field on the first form that holds the ID and "PartID" to the name of the field on the form to open

Hope it helps

Thanks

Dan
 
It works

I applied what you have suggested and lo and behold: it works.
I have no clue what I'm doing, but I will be back.

Thank you very much.
 

Users who are viewing this thread

Back
Top Bottom