• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 894
  • Last Modified:

MS ACCESS SAVE + CLEAR FORM

Hi I have the database attached

In the MetricCollectionListBox form I'm trying to save and clear all fields however it seems to work partially. As soon as I do another record by selecting another division it goes back to the previous record and if I do it the second time then it starts with a new record.
MetricDatabaseFormStartupForm.accdb
0
FAH_
Asked:
FAH_
  • 4
  • 2
  • 2
2 Solutions
 
als315Commented:
All fields on your form are bounded. You are not obliged to save anything when you go to new record. Remove DoCmd.RunCommand acCmdSaveRecord.
If you like to select existing record, add unbounded field and add filter by this value.
0
 
FAH_Author Commented:
Even when I remove the acCmdSaveRecord is still doing the same thing i.e. It clears all the fields however when I try to select a division from the drop down it goes to the previous record and when i select it again the divison changes however all the other fields don't
0
 
Jeffrey CoachmanMIS LiasonCommented:
Then we need to really clarify what you mean by:
"save and clear all fields", ..."

When you create a new record, you select values from all of the comboboxes and enter values in all of the textboxes.
Then simply move to the next (or new) record.
At that point you are in a new record, ...and all the controls should be blank.
Then start over with this new record.

In your form (on the combobox after Update events) you are "clearing" other comboboxes, ...but also, Requerying the combobox itself, ...*then requerying the form*

Why are you requerying the combobox and then the form?
The Form requery is what is throwing you back to the first record.

In a normal situation like this (bound controls) there is no need for any code on the after update event of the combobox.

So you will have to explain why you have this code on your comboboxes...

JeffCoachman
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
FAH_Author Commented:
The requerying is done to bring in other values based on first selection for example if someone selects 311 then only the services / activity / sub activity related to 311 can be selected only.
0
 
Jeffrey CoachmanMIS LiasonCommented:
Then, as far as I can tell, you still don't need the Form Requery (me.requery)
...again, this is ultimately what is slamming you back to the first record...
0
 
FAH_Author Commented:
Thanks that solved that issue...


Secondly How can I retrieve all the information stored in the table if the user selects a certain div / service/ activity

I have entered the information and press the save / refresh button and it has saved all the info yet when I enter the div service activty combination I'm still getting the blank fields.
0
 
als315Commented:
If your fields are based on queries, you can requery each field separately.
Me.MyComboBox.requery
0
 
FAH_Author Commented:
i DIDN'T
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now