Access Vba Set Form to Continuous

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

Try...

 DoCmd.GoToRecord , , acNewRec

...in the On_Open event of the Form.

Gina Whipp
Microsoft MVP (Access 2010-2015)
https://www.access-diva.com/tips.html

5 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hi Gina

Thanks for the help. I forgot to mention that the frmIntraRxData is also a subform.

I tried what you told me. But everytime the formIntraRxData looses focus and then when the form is re-entered, despite the code when the time is entered it changes the time of the first record, even when the user clicks the TimeRecorded control. I tried your code not only in the Open event of the form but also in various other events like On Activate, on Load events as well. Not sure what is going on.

Thanks

HNIM2010

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

No that won't work on a subform and before I say anything else...

1. Does Main form open to a record or ready to accept new data?

2. How are the Main form/Subform linked?

3. Do you only want new records added?

Gina Whipp
Microsoft MVP (Access 2010-2015)
https://www.access-diva.com/tips.html

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

The main form opens records for a particular patient on a particular date. The SubForm opens and it is linked to the AccountNumber and the date of the main form. Since the subform is a continuous form it shows all the records for that patient on that day while the patient is still undergoing the treatment. During the treatment BP is recorded about 6 to 10 times. Time recorded is the first control on the record of the subform. Yes new records need to be added until they are discharged after the treatment is completed.

It works well until the main form is changed to another patient who is under going the treatment at the same time. Two things happen when the main form is changed to another patient. The sub form records change without any problems. With the first time change everything works well as it supposed to. But then when the user moves from one patient to another patient, even though the user clicks the on the new record control of TimeRecorded on the subform, after the time is entered instead of inserting in that field as new data it changes the first records of the subform.  (The way the time is entered is as follows: It is touch screen program. When the TimeRecorded control is clicked a Keypad - pop up form -  appears on the screen. Once they enter the time touching on the on the keypad and touch the enter key on the keypad form it inserts that time into the control that they touched)

Hope this helps

Regards

HIM2010

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Let me see if I understand this...  So only when a User clicks to go to a New Record do no new records appear in the subform?  If this is correct, does the combo box change to be blank?  Also, what is the code on the New Record button.

Gina Whipp
Microsoft MVP (Access 2010-2015)
https://www.access-diva.com/tips.html

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I think I am creating more confusion by coning down to the problem and asking the question. Let me give you the whole picture.

Main form Name: Acorn      and it has four sub forms (and they are NOT continuous forms)

Subform names: Acorn1, Acorn2, Acorn3 and Acorn4

Each  subform has a combobox with a macro that selects the patient. The patient name is displayed in large letters in a control "NameOfPt". Each subform has a button "TreatmentRecord". At the out set the user selects one patient in each subform. All the subforms remain open. They are small sized and occupy one below the other on the left side of the main form Acorn.

Each of the subform also has a button "TreatmentRecord". When the user clicks the button, the treatment record which is a form called "frmRx" (and it is NOT a subform of this Main form: Acorn) opens. frmRx is linked by the account number of the patient of the corresponding Acorn1,....Acorn4.

At the start of the day, user enters or selects four patients in Acorn1,....Acorn4. The user moves between the treatment records by clicking the button.

The problem I mentioned is with the frmRx which is the Main form and the frmIntraRxData (the subform which is a continuous form). Again the details of the problem are as I mentioned earlier.

I really appreciates your help.

Regards

HNIM2010

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Also when  the user closes the frmRx before opening another frmRx everything goes well. It is only when the user does not close the frmRx and tries to switch between the patients the problem arises. It saves when switching alright. Giving another Save  button to click  does not solve the problem.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Okay, now let's see if I got this right...

It's only the opened frmRX that is not changing Patients when switching between Patients on fromAcron (or any of its subforms).  Is that correct?

Gina Whipp
Microsoft MVP (Access 2010-2015)
https://www.access-diva.com/tips.html

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

No. When switching the patients the frmRx does change appropriately to with the corresponding data for the patient selected. So does its subform frmIntraRxData appropriately. The data in the frmIntraRxData records are also appropriate.

The problem is when they move between the patients, and click on the control [TimeRecorded] of the new record in the continuous form frmIntraRxData  to enter the time the data goes to the first record of the subform and changes the old data!. I solved that temporarily a few mins ago by using the

       DoCmd.GoToRecord , , acNewRec in the on click event of the CONTROL  [TimeRecorded]. When this DoCmd was inserted into the on open event of the form it did not work! Other codes of SetFocus etc also did not work.

On the other hand if they close the frmRx each time and click the command button to open another patient it works fine

Regards

HNIM2010

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I am having an issue envisioning this BUT since you got it to work, don't think it's important.  Not sure why you would think that a temporary fix, if it works.  Does something else happen that makes you think you should do it that way?  And no, once you detailed the issue, I knew putting the DoCmd in the On_Open event was not going to work.

Gina Whipp
Microsoft MVP (Access 2010-2015)
https://www.access-diva.com/tips.html

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

scottpetry1973.blogspot.com

Source: https://answers.microsoft.com/en-us/msoffice/forum/all/continuous-form-need-to-set-focus-on-new-record/8822d2fc-2950-4660-9064-dab132fb6108

0 Response to "Access Vba Set Form to Continuous"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel