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:office:office" /><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

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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