button wizard

Chrisopia

Registered User.
Local time
Today, 01:38
Joined
Jul 18, 2008
Messages
279
Th button wizard isn't creating buttons properly!?

I need it to create a button that opens a form relative to the customerID already in use... but it doesn't seem to work and it just brings up the first record and says it's been filtered, when clearly is hasnt.

Code:
Option Compare Database
Private Sub Command6_Click()
On Error GoTo Err_Command6_Click
    Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "002"
    
    [COLOR=red]stLinkCriteria = "[CustomerID]=" & Me![CustomerID][/COLOR]
    DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command6_Click:
    Exit Sub
Err_Command6_Click:
    MsgBox Err.Description
    Resume Exit_Command6_Click
    
End Sub

I highlighted the part I thinik the wizard didn't creat properly!?

This is really frustrating right now.
 
I have just noticed something which makes things a little complicated...

the button doesnt seem to work with a 1 to many relationship...

for example, an Order holds an OrderDetails (one to many, one order can have many order details), however wehn i click the button in the order form to open the orderdetails form it doesn't seem to find the orderID from the order form.
Plus I need to create many items in the orderdetails but to have the same OrderID.

hmph
 
Why not place a sub form on your customer form which shows the relevant orders For that customer?

This is the way it's normally done, and MS Access is set up to support doing things this way, any other way means you need to program it yourself.
 
its funny you say that... that was my origonal method but it was complicated to add data to it.
For example, an order wasn't truely unique to the customer for some reason.

I was trying a wizard type method of filling in an invoice... this way nothing gets missed out either. Then at the end you can view the entire invoice.

Very user friendly.
 

Users who are viewing this thread

Back
Top Bottom