Getting error for Command button & Need help with print configuration

donsi

Registered User.
Local time
Today, 08:15
Joined
Sep 1, 2016
Messages
73
Hello,

I have a "Submit" button on the form and in the event "On Click" I enter marcos as RunCommands to SaveRecord, SelectRecord, PrintSelection and RecordsGotoNew.

Now it runs first three commands successfully but when RecordsGotoNew comes, it is giving me an error

"The Command or action "RecordsGoToNew" isn't available now.
*You may be in a read-only database or an unconverted database from an earlier version of MS Access.
*The Type of object the action applies to ins't currently selected or isn't in the active view.
Use only those commands and macro actions that are currently available for this database. "


If I have two separate button for Print and "Save & New Record" it works just fine. Any solutions to this?

On second issue, I would like print 3 copies selected record on the same paper. I designed the form to fit on 8.5 X 11 page paper three time. is it possible to get this done?

Thank you
 
You can get
"The Command or action "RecordsGoToNew" isn't available now.

when the form doesn't have focus but I've tried to replicate your situation I'm not getting this error. Could you upload you database?


As far as printing 3 copies on the same page I suggest designing you report that way, i.e., just repeat the fields three times. When you have the report in design view you will see "Add Existing Field" in the ribbon. Just drag the fields from there multiple times and place them where you want.
 
I think that is the problem that form is losing focus thus the error.

I couldn't attached the original so I create another which reproduce the behavior.

Please check it out.

Thank you
 

Attachments

Just an update. The reason why I wasn't getting the error was because the form I created to test this wasn't a popup. The macro works in a normal form. I'm trying to figure out what to add to get the focus back on the popup.
 
If you select the form as shown below before the RecordGoToNew it clears up the problem.

attachment.php
 

Attachments

  • SelectForm.jpg
    SelectForm.jpg
    55.9 KB · Views: 669
That worked like a charm buddy. Thank you very much.

Now the trouble is with the printing 3 copies of the form on one paper. We have single three part paper(different color each) which user tears and puts it together to sign and distribute. So i want the form to print in all three portion of it so it will be duplicate copies.

Once again appreciate the fix.
 
Facing another issue now. When I have form part of the Navigation form tab.
1. It prints all the records instead of just selected one
2. Throws an error for RecordsGoToNew

I updated Macro little bit but results are same.
 

Attachments

  • Macros for Submit button.PNG
    Macros for Submit button.PNG
    9.2 KB · Views: 75
  • Error msg1.PNG
    Error msg1.PNG
    21.4 KB · Views: 113
  • Error msg2.PNG
    Error msg2.PNG
    31.9 KB · Views: 98
I can't say for sure without see how you have you Navigation Form set up but a form in a tab would have a reference something like:
Code:
Forms![Navigation Subform]

Can you upload your database?
 
I can't say for sure without see how you have you Navigation Form set up but a form in a tab would have a reference something like:
Code:
Forms![Navigation Subform]

Can you upload your database?

Here is the test database. I recreated the error I am receiving. Also the printing issue.

Thank you
 

Attachments

Sorry but I'm not getting anywhere on this one. You might consider starting a new thread so that it might get more attention by other forum members. You could title it something like "How do you update a macro when you move it's form to a navigation form?" I suggest posting the image of the macro and the database.
 
I added a sloppily created report in the attached database and a button (Print Report) on the FrmsTransaction form that run a macro that prints three copies of the current record. Note the Where clause in the OpenReport command to see how this is done. The report currently opens a dialog window. You will probably want to change the Window Mode to Normal.

I didn't figure out how to make it go to a new record but maybe this will help some.
 

Attachments

Steve,

Thank you for the setting up print function for me. That was very helpful. After spending crazy hours to get the form to go to new record, i just figured it out. I set the Modal property from No to YES (keeps focus on the window until closed) and then just applied the macros without SelectObject or GoToControl, and it worked!!! Now I can move on to next challenge.

Once again, thanks for all the help you provided.
 

Users who are viewing this thread

Back
Top Bottom