Error on copy record

coolcatkelso

Registered User.
Local time
Today, 13:20
Joined
Jan 5, 2009
Messages
279
Hiya guys

I have this form called Quotes which is the main form for making a quote lol, it also contains a subform which lists the materails & Labour.. There is 2 buttons that have been created by someone on here ages ago for me.. the purpose of the buttons is

BUtton Name (Create Base Order)
This button creates a new "Workorder" in a diffrent table / form and looks up the LAST WorkorderID and assigns the quote with that workorder

The second button is Update Workorder

This button is the one that actually copys the details over to the workorder

The reason for this is so I don't have to write a quote then when its accepted have to re-do it as a workorder

The code behind the form almost works great but 2 issues I have found with it

Issue 1 - When I click the update (It doesn't copy over the Labour from the quotes - only the materals)

Issue 2 - When I go to print a BASIC quote (Without creating the workorder) It will only show the LAbour on the report and not the materials

I think I'm missing somesort of link somwhere but don't know where

Here is the code for the button - Create Base Order

Code:
Private Sub Create_Workorder_Click()
Dim xTime As Single, yTime As Single
MsgBox "Enter Materials & Labour and then UPDATE WORKER"
'Set the global long variable to Last Work Order ID
LstID = ShowIdentity
'If Lstid is not 0 do something
If LstID <> 0 Then
'Set Control Focus
WorkorderID.SetFocus
'Display the Global Variable somewhere
WorkorderID.Text = LstID
End If
'0 out the Variable
LstID = 0

End Sub

This is the code for button - Update Workorder
Code:
Private Sub Command73_Click()
    
    On Error GoTo Err_ErrorHandler
    With DoCmd
        .SetWarnings False
        .OpenQuery "Quote Material Query"
        .SetWarnings True
        .SetWarnings False
        .OpenQuery "Quotes Labour Query"
        .SetWarnings True
    End With
Exit_ErrorHandler:
    Exit Sub
Err_ErrorHandler:
    MsgBox Err.Description, vbExclamation, "Error #" & Err.Number
    Resume Exit_ErrorHandler
End Sub

Any help?
________
Mexicocity Hotel
 
Last edited:

Users who are viewing this thread

Back
Top Bottom