Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

clearing form except for certain fields

Avatar of JARICHARDUSA
JARICHARDUSAFlag for United States of America asked on
Microsoft AccessVB Script
9 Comments1 Solution680 ViewsLast Modified:
This is what I'm trying to do.

I have a form in which a user enters all information for a part in order to add this part into a database.  If however the user has multiple numbers of the same part, instead of recreating everything from scratch, I want it so that the user just has to click a "save and duplicate" button in which case the data they just entered will be saved as a record in the database and then the form will requery but maintain the information incertain fields such as part name, NSN, ect. (basically the fields that will not change at all for that particular part) and the other fields will be empty for entering the new information such as Serial Number and such.  The following is the code I currently have on that button:

Private Sub Command92_Click()
On Error GoTo Err_Command92_Click
DoCmd.RunCommand acCmdSaveRecord


    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
Me.Base = ""
Me.Building = ""
Me.txtHRDate = ""
Me.txtComments = ""
Me.txtContactNumber = ""
Me.txtHRTo = ""
Me.txtHRDueDate = ""

Exit_Command92_Click:
    Exit Sub

Err_Command92_Click:
    MsgBox Err.Description
    Resume Exit_Command92_Click
   
End Sub

This, however, is giving me an error:  "object does not support this property or method"
The record is being saved to the database, though, its just giving me the above error and then not clearing out the fields I'd like cleared prior to creating a new record.