Go Back   Access World Forums > Microsoft Access Discussion > Macros

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-21-2019, 09:58 AM   #1
jedder18
Just Livin the Dream!
 
Join Date: Mar 2012
Posts: 135
Thanks: 31
Thanked 9 Times in 9 Posts
jedder18 is on a distinguished road
Search Button Macro give incorrect field

I've attached screen shots of the search macro and forms in use.
I am not certain how the macro is working.
It is supposed to be searching for the Episode ID and when selected should open the info for who it belongs to.
However, it is putting that id into the participant name and bringing over the data that matches that.
Not sure when, or how it ever got changed.
The background of the form it ends up presenting the info on is run off a query with the Client ad Episode tables, linked by ClientID

I'm trying to find out how to get it back to searching for the episode and placing the correct info into form that matches the client to that episode.
Attached Images
File Type: jpg macro.JPG (42.1 KB, 21 views)
File Type: jpg macroerror.jpg (73.7 KB, 19 views)

jedder18 is offline   Reply With Quote
Old 10-21-2019, 10:08 AM   #2
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,538
Thanks: 58
Thanked 1,429 Times in 1,410 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Search Button Macro give incorrect field

Hi. How exactly is the macro executed/initiated?
__________________
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 10-21-2019, 10:42 AM   #3
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,569
Thanks: 68
Thanked 2,745 Times in 2,630 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Search Button Macro give incorrect field

edit the macro.
change the GotoControl->ControlName=[Episode ID]

__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 10-21-2019, 10:57 AM   #4
jedder18
Just Livin the Dream!
 
Join Date: Mar 2012
Posts: 135
Thanks: 31
Thanked 9 Times in 9 Posts
jedder18 is on a distinguished road
Re: Search Button Macro give incorrect field

The macro is initiated when you press the search button
jedder18 is offline   Reply With Quote
Old 10-21-2019, 11:05 AM   #5
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,538
Thanks: 58
Thanked 1,429 Times in 1,410 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Search Button Macro give incorrect field

Quote:
Originally Posted by jedder18 View Post
The macro is initiated when you press the search button
Okay, my guess is when you press the button, you didn't have the focus on the right field prior to clicking it. If so, then you should try Arnel's suggestion and simply specify which field to search.
__________________
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 10-22-2019, 06:34 AM   #6
jedder18
Just Livin the Dream!
 
Join Date: Mar 2012
Posts: 135
Thanks: 31
Thanked 9 Times in 9 Posts
jedder18 is on a distinguished road
Re: Search Button Macro give incorrect field

I fixed it.
Had to change the tab order.
the field needed(Episode#) was 2nd in order, the 1 that would populate was 1st.
jedder18 is offline   Reply With Quote
Old 10-22-2019, 06:52 AM   #7
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,538
Thanks: 58
Thanked 1,429 Times in 1,410 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Search Button Macro give incorrect field

Quote:
Originally Posted by jedder18 View Post
I fixed it.
Had to change the tab order.
the field needed(Episode#) was 2nd in order, the 1 that would populate was 1st.
Hi. Glad to hear you got it sorted out. Good luck with your project.

__________________
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 10-29-2019, 05:23 AM   #8
jedder18
Just Livin the Dream!
 
Join Date: Mar 2012
Posts: 135
Thanks: 31
Thanked 9 Times in 9 Posts
jedder18 is on a distinguished road
Re: Search Button Macro give incorrect field

so the tab order only worked on the 1st instance of finding the next episode
after that, it keeps putting the episode ID into the Participant ID field even tho I speficied the control name of EPID
Any thoughts? I've tried closing the form in the macro when it opens the next form, but, when going back to 1st form, same thing happens, the ep ID that is being asked for ends up in the participant field and therefore the remaining buttons on the form calling for the episode do not give correct info.
jedder18 is offline   Reply With Quote
Old 10-29-2019, 06:51 AM   #9
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,538
Thanks: 58
Thanked 1,429 Times in 1,410 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Search Button Macro give incorrect field

Are you able to post a demo version of your db for review?
__________________
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 10-29-2019, 11:08 AM   #10
jedder18
Just Livin the Dream!
 
Join Date: Mar 2012
Posts: 135
Thanks: 31
Thanked 9 Times in 9 Posts
jedder18 is on a distinguished road
Re: Search Button Macro give incorrect field

sadly can not post demo version.
It's a huge db, and hipaa rules exist.

anyhow, 1 of the things I did which seem to be working..

The form is started off with a search button to find an ID.
when ID found, there are multiple buttons underneath for multiple forms/reports etc all tied to found ID.

Each of the buttons is a macro, which I added the command close window of the main form that was searching for ID.
IT seems to be working now and gets the focus back to the search ID button when form is reopened.
Seems like alot of hassle, but, it's working and I'm going with it.
It just would not work if I left that form open. Would never get focus back to the correct field.

I will keep you all posted.
Thanks for all the help.
jedder18 is offline   Reply With Quote
Old 10-29-2019, 11:14 AM   #11
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,538
Thanks: 58
Thanked 1,429 Times in 1,410 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Search Button Macro give incorrect field

Hi. Glad to hear you found a solution. Good luck with your project.

__________________
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
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to edit field if button pressed megatronixs Macros 1 03-23-2013 08:42 AM
Macro for search button gary g Macros 2 03-09-2012 07:46 AM
'Find' button error -the control the macro is attempting to search can't be searched imconfused Modules & VBA 4 09-24-2008 01:37 AM
[SOLVED] How to write a macro that does a search on a field in a table?? learning_access Macros 2 05-25-2006 01:08 AM
Form macro button hyperlink with field name wakeywakey Forms 0 03-17-2005 01:39 AM




All times are GMT -8. The time now is 01:08 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