help i need to add a combo box to a form

karr86

New Member
Joined
Sep 13, 2009
Messages
1
I need some help. I need to add a combo box to a form. When I make a selection in the combo box and add the Info to my form it goes to the truck I select. But if I don’t enter Data in then text box it will delete my data off my sheet. And one more thing I need to enter it on a different sheet. So when I select the truck in the combo box and enter the data in. It will go to PM_SUMMARY and to the truck log. There are like 50 of them. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p> </o:p>
sheet are 7-9301<o:p></o:p>
7-0302 <o:p></o:p>
PM_SUMMARY
Private Sub cmdAdd_Click()
Dim ws As Worksheet
Set ws = Worksheets("PM_SUMMARY")
'check for a date
If Trim(Me.txtDate.Value) = "" Then
Me.txtDate.SetFocus
MsgBox "Please enter a Date "
Exit Sub
End If
'check for a hours
If Trim(Me.txtHR.Value) = "" Then
Me.txtHR.SetFocus
MsgBox "Please enter a Mileage/Hours"
Exit Sub
End If
'copy the data to the database
ws.Cells(6, 10).Value = Me.txtDate.Value
ws.Cells(6, 6).Value = Me.txtDot.Value
ws.Cells(6, 14).Value = Me.txtDatePm.Value
ws.Cells(6, 12).Value = Me.txtHR.Value
ws.Cells(6, 16).Value = Me.txtPm.Value
End
Unload Me
End Sub
Private Sub txtDate_Change()
Me.txtDate.Value = Date
End Sub
Ok a lot of it lol
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top