Problem with the code

S

Simon

On my form i have a subforms ( frmManufacturePartsUsed ) also have a
button that will copy data into the subform when it is pressed. If data
already exists in the subform no data is copyed and error message

This was working but now i get the following error 'Application-defined
or object-defined error'

any idea why it does not work now

If Not IsNull(Me.frmManufacturePartsUsed.Form.ProductCode) Then (
ERROR on this Line)
MsgBox "Stock has already been Allocated.", vbInformation, "Stock
Allocated"
Exit Sub
End If

Me.Refresh
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70


DoCmd.SetWarnings False
DoCmd.OpenQuery "Query1"
DoCmd.SetWarnings True



Me.Refresh


End Sub
 
G

Guest

What changed? Upgrade to a new version or something?

Can you still run Query1?

Then there's DoCmd.DoMenuItem. That can cause problems as if the menu
changes, it stops working. Look for the appropriate DoCmd.RunCommand. To save
a record, this is it:

DoCmd.RunCommand acCmdSaveRecord
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top