Hello all,
Having some issues with VBA, i'm quite new at it so hopefully its a really simple fix.
<tbody>
</tbody>
Ok, so this code works well and i'm happy with it, but this is on a form called 'Form4BookingForm'. This form is where everyone enters their details as you can probably tell from the code. I want this to go to another Form where they confirm all their details as a couple of other bits are added from other forms on the database. On this confirmation form 'Form5Confirmation' i want a button to link to back to Form4 to save all the details into my table. Now I've tried several things and everything doesn't work. The simplest one i have found is:
<tbody>
</tbody>
Now in order for this button to work i've read that i have to change 'Private Sub' to 'Public Sub' on both VBA codes....... this is where the issue is. If i change the main code to public it makes the code not work. But without it being public this button won't work...... any suggestions???
Thanks to anyone who might help
Having some issues with VBA, i'm quite new at it so hopefully its a really simple fix.
Private Sub cmdsaveandclose_Click() CurrentDb.Execute "INSERT INTO BookingDetails (FirstName, Surname, Email, TelephoneNumber, JobTitle, Placeofwork, Area, Date1, Date2)" & _ " VALUES('" & Me.txtfirstname & "','" & Me.txtsurname & "','" & Me.txtemail & "','" & Me.txttelephonenumber & "','" & Me.txtjobtitle & "','" & Me.txtplaceofwork & "','" & Me.txtareabox & "','" & Me.txtdate1 & "','" & Me.txtdate2 & "')" cmdclear_Click 'clear form DoCmd.CloseDatabase 'close database End Sub |
<tbody>
</tbody>
Ok, so this code works well and i'm happy with it, but this is on a form called 'Form4BookingForm'. This form is where everyone enters their details as you can probably tell from the code. I want this to go to another Form where they confirm all their details as a couple of other bits are added from other forms on the database. On this confirmation form 'Form5Confirmation' i want a button to link to back to Form4 to save all the details into my table. Now I've tried several things and everything doesn't work. The simplest one i have found is:
Private Sub cmdsave_Click() Form4BookingForm.cmdsaveandclose_Click End Sub |
<tbody>
</tbody>
Now in order for this button to work i've read that i have to change 'Private Sub' to 'Public Sub' on both VBA codes....... this is where the issue is. If i change the main code to public it makes the code not work. But without it being public this button won't work...... any suggestions???
Thanks to anyone who might help