Duplicate a booking record with a number of frequency (1 Viewer)

paul young

Registered User.
Local time
Today, 06:45
Joined
Aug 15, 2003
Messages
22
:confused:

Hi!
With help, I created a coding to duplicate a booking record. Now I need to duplicate a booking record by a number of frequency. In other words, if I want to duplicate a booking by 52 weeks, it would do so automatically with the correct future dates installed. This saves having to duplicate the form 52 times manually.
Below the coding I already have that just duplicate a booking record details. I would like to put in a coding to do the frequency thing.


Private Sub bDuplicateCurrentRecord_Click()
On Error GoTo Err_bDuplicateCurrentRecord_Click

Beep

Dim sBookingID As String
Dim sSerialNo As String
Dim sNoOfBookingPerRequistionNo2 As String
Dim sNameOfHost As String
Dim sTrustOrNonTrust As String
Dim sDepartment As String
Dim sContactTelephone As String
Dim sContactMobile As String
Dim sContactFax As String
Dim sDateOfRequest As String
Dim sDateOfFunction As String
Dim sTimeRequiredStart As String
Dim sTimeRequiredEnd As String
Dim sVenue As String
Dim sReasonForBooking As String
Dim sNoOfGuests As String
Dim sStandingOrder As String
Dim sComments As String
Dim sBookingReceivedBy As String
Dim sNonStandardCharge As String

sBookingID = BookingID
sSerialNo = SerialNo
sNoOfBookingPerRequistionNo2 = NoOfBookingPerRequistionNo2
sNameOfHost = NameOfHost
sTrustOrNonTrust = TrustOrNonTrust
sDepartment = Department
sContactTelephone = ContactTelephone
sContactMobile = ContactMobile
sContactFax = ContactFax
sDateOfRequest = DateOfRequest
sDateOfFunction = DateOfFunction
sTimeRequiredStart = TimeRequiredStart
sTimeRequiredEnd = TimeRequiredEnd
sVenue = Venue
sReasonForBooking = ReasonForBooking
sNoOfGuests = NoOfGuests
sStandingOrder = StandingOrder
sComments = Comments
sBookingReceivedBy = BookingReceivedBy
sNonStandardCharge = NonStandardCharge

DoCmd.GoToRecord , , acNewRec

'BookingID.Value = sBookingID ILLEGAL ASSSIGNMENT!!!!
SerialNo = sSerialNo
NoOfBookingPerRequistionNo2 = sNoOfBookingPerRequistionNo2
NameOfHost = sNameOfHost
TrustOrNonTrust = sTrustOrNonTrust
Department = sDepartment
ContactTelephone = sContactTelephone
ContactMobile = sContactMobile
ContactFax = sContactFax
DateOfRequest = sDateOfRequest
DateOfFunction = sDateOfFunction
TimeRequiredStart = sTimeRequiredStart
TimeRequiredEnd = sTimeRequiredEnd
Venue = sVenue
ReasonForBooking = sReasonForBooking
NoOfGuests = sNoOfGuests
StandingOrder = sStandingOrder
Comments = sComments
BookingReceivedBy = sBookingReceivedBy
NonStandardCharge = sNonStandardCharge

sBookingID = ""
sSerialNo = ""
sNoOfBookingPerRequistionNo2 = ""
sNameOfHost = ""
sTrustOrNonTrust = ""
sDepartment = ""
sContactTelephone = ""
sContactMobile = ""
sContactFax = ""
sDateOfRequest = ""
sDateOfFunction = ""
sTimeRequiredStart = ""
sTimeRequiredEnd = ""
sVenue = ""
sReasonForBooking = ""
sNoOfGuests = ""
sStandingOrder = ""
sComments = ""
sBookingReceivedBy = ""
sNonStandardCharge = ""

Exit_bDuplicateCurrentRecord_Click:
Exit Sub

Err_bDuplicateCurrentRecord_Click:
If Err = 94 Then 'Invalid use of Null'
Beep
MsgBox "A box is incomplete. Please ensure that all boxes are completed before attempting to duplicate the current booking", vbInformation, "Invalid Duplication"
Exit Sub
Else
If Err = 2113 Then 'The data you entered is not valid for this box.
Exit Sub
Else
MsgBox Err.Description
Resume Exit_bDuplicateCurrentRecord_Click
End If
End If

End Sub

Can anyone help me out?

Thanks.

Paul

:rolleyes:
 

Users who are viewing this thread

Top Bottom