Private Sub cmd_New_Click()
Dim Response%
If Me.Dirty Then
Response = MsgBox("Save changes to the job record?", vbYesNoCancel, scAppTitle)
Select Case Response
Case vbYes
SendKeys "+{Enter}"
Case vbNo
Me.Undo
Case vbCancel
Exit Sub
End Select
End If
cbo_SourceID.Requery
DoCmd.GoToRecord acDataForm, Me.Name, acNewRec
DoCmd.GoToControl CtlName(Me, 0)
End Sub
Recordset from comments below
SELECT tbl_Jobs.*,
tbl_JobLocations.*,
tbl_Invoices.*,
tbl_Clients.client_ClientNumber,
tbl_Clients.client_PrimaryContactID,
tbl_Clients.client_Name,
tbl_Clients.client_Address,
tbl_Clients.client_Phone,
[jobl_KeymapPage] & [jobl_KeymapGrid] AS qcalc_KMC,
[client_City] & " " & [client_State] & " " & [client_Zip] AS qcalc_ClientCSZ,
[appr_FirstName] & " " & [appr_LastName] AS qcalc_ApprName,
tbl_Appraisers.appr_Initials,
tbl_Borrowers.bor_BorrowerName,
tbl_Borrowers.bor_Address,
tbl_Borrowers.bor_City,
tbl_Borrowers.bor_State,
tbl_Borrowers.bor_Zip,
tbl_Borrowers.bor_Phone,
tbl_Borrowers.bor_Fax,
tbl_Borrowers.bor_Email,
tbl_Borrowers.bor_Remarks,
tbl_SaleSources.ssor_SourceDescription,
tbl_Invoices.inv_RetainerInvoiceDate AS RetainerDate
FROM (tbl_Clients
INNER JOIN (tbl_Appraisers
RIGHT JOIN (((tbl_SaleSources
RIGHT JOIN tbl_Jobs
ON tbl_SaleSources.ssor_SourceID = tbl_Jobs.job_SaleSourceID)
LEFT JOIN tbl_Invoices
ON tbl_Jobs.job_JobNumber =tbl_Invoices.inv_JobNumber)
LEFT J开发者_如何学PythonOIN tbl_Borrowers
ON tbl_Jobs.job_JobNumber = tbl_Borrowers.bor_JobNumber)
ON tbl_Appraisers.appr_AppraiserID = tbl_Jobs.job_AppraiserID)
ON tbl_Clients.client_ClientID = tbl_Jobs.job_ClientID)
LEFT JOIN tbl_JobLocations
ON tbl_Jobs.job_JobNumber = tbl_JobLocations.jobl_JobNumber
ORDER BY tbl_Jobs.job_JobNumber;
Does your form and recordset allow additions? You can check this by looking at the navigation bar at the bottom of the form to see if the star (>*) is greyed out.
To open the property sheet, change the form to design view and select View->Properties from the menu.
Look at Allow Additions, if this is No, then that is probably the answer. Change it to Yes and check again if you can update the form, if this has not fixed the problem then ...
Look at the data tab, you will see Record Source - this is the data that the form is based on. If it is the name of a query, open the query and see if you can add a row to it. If it is an sql string (SELECT Stuff FROM table), cut and paste it as a comment.
精彩评论