Well I managed to get it working. I took a different approach. Instead of making the form based off the table, I made the form based off a query with just the material field listed. Then made the combo box from that query and the update worked. Now I just have to have get the combo box to...
Here is what comes out on the Immediate Window
UPDATE tblMoldSetUpSheet SET tblMoldSetUpSheet.Material = 'Trial' WHERE tblMoldSetUpSheet.Material = '1428-2'
The Set function is right but the Where function is wrong. The 1428-2 is the part number field, not the Material field. For some reason...
Yeah I seen the miss-spelling of the cmbCurrentMaterial. That was just a mistype on my part in the thread. It is spelled right in the code.
I didn't notice any updates to the table when the event ran. Will try the debug print and see what it comes up with..
Thanks
I copied what you had and put in the on click event
Private Sub cmdUpdate_Click()
DoCmd.RunSQL “UPDATE tblMoldSetUpSheet SET Material = '" & Me.txtNewMaterial & "' WHERE Material = '" & Me.cmdCurrentMaterial & "'"
End Sub
I got a compilie error in VBE when I tried to enter the code...
Looking for some clarification on how to write some VBA code for a task I am trying to perform. I know this is probable covered numerous times on these forums, when I performed a search I did not come up with anything that was matching to my problem. The bad thing is that this is such a simple...
I kind of took the long way about this. What I ended up doing is putting this If statement:
If (Running_Total >= PmCycle) Then
MsgBox "Time for tool to be PM'd"
End If
In the OnExit event on each data field. I probable could have made a general statement, but I am just learning VBA and this...
If I put that in the On Current event on the Form, once I switch records the message box will come up, but need to have the message box come up as soon as the Running Total is >= the Pm Cycle total. Thats where I am running into the problem.
This seems to be something easy to do, but I have yet to be able to get it working right. I have a field called Running Total that automatically updates as it calculates numbers being put into other fields. When the Running Total is >= to a certain number I would like a message box to automatic...