Wayne Cramer
Registered User.
- Local time
- Today, 02:43
- Joined
- Aug 10, 2007
- Messages
- 93
I have a database where the majority of fields are the same record to record. For instance the only thing that changes is the line item number for a purchase order. I have a button that copies most of the fields to the next record (code is below). The problem is that if any field does not have content I get a debug error. Can code be added to accept blank (null) entries for some of the fields? Any help is greatly appreciated.
Private Sub Command230_Click()
Dim sVendor_Name As String
Dim sIssue_Generator As String
Dim sIssue_Type As String
Dim sIssue_Description_and_Resolution As String
Dim sOther_Explanation As String
Dim sRequestor As String
Dim sResponsible_Party As String
Dim sCell As String
Dim sQuote As String
Dim dtmDateAndTime As Date
sVendor_Name = Vendor_Name
sIssue_Generator = Issue_Generator
sIssue_Type = Issue_Type
sIssue_Description_and_Resolution = Issue_Description_and_Resolution
sOther_Explanation = Other_Explanation
sRequestor = Requestor
sResponsible_Party = Responsible_Party
sCell = Cell
sQuote = Quote
dtmDateAndTime = DateAndTime
DoCmd.GoToRecord , , acNewRec
Vendor_Name = sVendor_Name
Issue_Generator = sIssue_Generator
Issue_Type = sIssue_Type
Issue_Description_and_Resolution = sIssue_Description_and_Resolution
Other_Explanation = sOther_Explanation
Requestor = sRequestor
Responsible_Party = sResponsible_Party
Cell = sCell
Quote = sQuote
DateAndTime = dtmDateAndTime
sVendor_Name = ""
sIssue_Generator = ""
sIssue_Type = ""
sIssue_Description_and_Resolution = ""
sOther_Explanation = ""
sRequestor = ""
sResponsible_Party_Party = ""
sCell = ""
sQuote = ""
End Sub
Private Sub Command230_Click()
Dim sVendor_Name As String
Dim sIssue_Generator As String
Dim sIssue_Type As String
Dim sIssue_Description_and_Resolution As String
Dim sOther_Explanation As String
Dim sRequestor As String
Dim sResponsible_Party As String
Dim sCell As String
Dim sQuote As String
Dim dtmDateAndTime As Date
sVendor_Name = Vendor_Name
sIssue_Generator = Issue_Generator
sIssue_Type = Issue_Type
sIssue_Description_and_Resolution = Issue_Description_and_Resolution
sOther_Explanation = Other_Explanation
sRequestor = Requestor
sResponsible_Party = Responsible_Party
sCell = Cell
sQuote = Quote
dtmDateAndTime = DateAndTime
DoCmd.GoToRecord , , acNewRec
Vendor_Name = sVendor_Name
Issue_Generator = sIssue_Generator
Issue_Type = sIssue_Type
Issue_Description_and_Resolution = sIssue_Description_and_Resolution
Other_Explanation = sOther_Explanation
Requestor = sRequestor
Responsible_Party = sResponsible_Party
Cell = sCell
Quote = sQuote
DateAndTime = dtmDateAndTime
sVendor_Name = ""
sIssue_Generator = ""
sIssue_Type = ""
sIssue_Description_and_Resolution = ""
sOther_Explanation = ""
sRequestor = ""
sResponsible_Party_Party = ""
sCell = ""
sQuote = ""
End Sub