Go Back   Access World Forums > Microsoft Access Discussion > Macros

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-17-2019, 06:33 PM   #1
tinher
Newly Registered User
 
Join Date: May 2019
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
tinher is on a distinguished road
Macro to enter data into subform

Hi,

I created a macro on a subform that does setProperty value to Bob in the helper field.

Works for first record in subform.

I only have 3 helpers Bob, Susan and Sam so I created 3 macros for each value.

So I created 3 macros they work fine. The problem is how do I make them move to new record.

some times Bob and Susan help and or all three help so I need 3 records added.

example if I run the Bob macro my macro adds the first record with Bob name. Then if I run the Sam macro it changes Bob to Sam in same record. Then if I run the Susan macro it changes Sam to Susan.

I want it to add a record for Bob when I run the Bob macro and add a record for Sam when I run the Sam macro. So I can see that Bob and Sam were helpers.

Thank you.

tinher is offline   Reply With Quote
Old 05-17-2019, 07:41 PM   #2
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 2,094
Thanks: 25
Thanked 543 Times in 531 Posts
theDBguy will become famous soon enough theDBguy will become famous soon enough
Re: Macro to enter data into subform

Hi. Can you show us your macro code?
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is offline   Reply With Quote
Old 05-18-2019, 04:25 AM   #3
tinher
Newly Registered User
 
Join Date: May 2019
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
tinher is on a distinguished road
Re: Macro to enter data into subform

I created a button and the on click is set to

SetProperty
ControlName Helper
Property Value
Value Bob

I need to add something that changes focus to next record but everything I have tried gives me an error.

This is in a subform so when I use goto new record or next record it says the form is not open

I tried the after update on the helper field also.


Thank you.


Last edited by tinher; 05-18-2019 at 04:38 AM.
tinher is offline   Reply With Quote
Old 05-18-2019, 05:08 AM   #4
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 9,945
Thanks: 452
Thanked 881 Times in 837 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Macro to enter data into subform

There are different ways of interpreting the problem. The first thing is the subform could either be in datasheet or form view. I suspect you mean it's in form view, however it would be beneficial to know for sure.

I would suggest you create a demonstration database, just the basic components extracted from your existing database to demonstrate what you have and if you can, indicate the results you want. If that's not possible, then some screenshots might provide enough information.

I personally wouldn't enter data directly into a form with code, I would enter it into the table underlying the form using an SQL Statement.
__________________
Code:
                 |||||
               @(~‘^‘~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is offline   Reply With Quote
Old 05-18-2019, 02:08 PM   #5
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 2,094
Thanks: 25
Thanked 543 Times in 531 Posts
theDBguy will become famous soon enough theDBguy will become famous soon enough
Re: Macro to enter data into subform

Quote:
Originally Posted by tinher View Post
I created a button and the on click is set to

SetProperty
ControlName Helper
Property Value
Value Bob

I need to add something that changes focus to next record but everything I have tried gives me an error.

This is in a subform so when I use goto new record or next record it says the form is not open

I tried the after update on the helper field also.


Thank you.
Hi. I just gave it a try and didn't get any error when I told the macro to go to a new record. Here's what my macro looked like:


Attached Images
File Type: png macro.png (6.8 KB, 18 views)

__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is offline   Reply With Quote
The Following User Says Thank You to theDBguy For This Useful Post:
tinher (05-18-2019)
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Enter data to subform with autopopulate calvinle Forms 11 06-25-2015 02:44 PM
Pausing Macro to Allow User to Enter Data Chrish Macros 8 08-15-2014 05:03 AM
Pause Macro to enter data DrPat Macros 3 08-21-2013 02:50 PM
Enter data in subform with button Mantispony Forms 13 05-06-2011 04:59 PM
Subform - Cannot enter data debbiekparsons Forms 9 04-15-2010 10:34 AM




All times are GMT -8. The time now is 05:24 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World