Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-26-2019, 06:40 AM   #1
ksor
Newly Registered User
 
Join Date: Feb 2018
Location: Aarhus V, Denmark
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
ksor is on a distinguished road
Get value from record by clicking on it ??

The situation is a user is adding a record for an social event - when finished he shall add participants to that event.

He can enter the participantsby entering all the values hemself (implemented !)
OR
he can click a butten to copy the participantsfrom another social event (not implementes yet )

The "copy"-butten is there to click ALL the time because participantscan only be add once !

My problem is - what "logic practice" should I use when the "copy"-butten is clicked - here are some code snips:

Code:
 
If MeldJaNej("Do you want to add participants from another event ? " & CrLf(2) & _
"Then click 'Yes' and READ statusline !" & CrLf(1) & _
                 "else click 'No' !") = vbYes Then


        ' what code should be here ??????
        
    End If

MeldJaNej just is my own simplified MsgBox !

In the status line I want to instruct the user to "Click the source event" or just press ENTER to cancel

Any ideas to the CODE or a different "logic practice" ?

ksor is offline   Reply With Quote
Old 10-26-2019, 06:52 AM   #2
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: Get value from record by clicking on it ??

how do you add participants? through subform?
you can use the subforms recordsource and select participants Not in subform.
or you can use an Insert Query to select participants Not in the form/subform and not on Same Event and add it to your table.

without fieldnames, tables, extbox name involved can't give you specific detail.
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 10-26-2019, 06:54 AM   #3
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,653
Thanks: 58
Thanked 1,459 Times in 1,440 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Get value from record by clicking on it ??

Hi. When the user clicks Yes, you'll have to provide a way for them to select the event to copy. This could be a dropdown or a listbox or a search form. Or, if the user will know the EventID, then it could be a simple InputBox.

__________________
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-26-2019, 07:02 AM   #4
ksor
Newly Registered User
 
Join Date: Feb 2018
Location: Aarhus V, Denmark
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
ksor is on a distinguished road
Re: Get value from record by clicking on it ??

OK, yeah ... af cause too few infos !
The social events are added through a continues subform, where the "source record" can be seen (or scrolled to be seen) and the participants are listed in a Subform to the SocialEvent Subform


I have now found out how to present the text in the status line - but how can I let the code wait for the user to click on the source record OR just press ENTER to cancel ?
ksor is offline   Reply With Quote
Old 10-26-2019, 07:10 AM   #5
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,653
Thanks: 58
Thanked 1,459 Times in 1,440 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Get value from record by clicking on it ??

Are you using a MsgBox?
__________________
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-26-2019, 10:49 AM   #6
ksor
Newly Registered User
 
Join Date: Feb 2018
Location: Aarhus V, Denmark
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
ksor is on a distinguished road
Re: Get value from record by clicking on it ??

Quote:
Originally Posted by theDBguy View Post
Are you using a MsgBox?

As I write in my posting I use my own simplified MsgBod called MeldJaNej(...)


Here is the code for the status line:


Code:
Sub ksStatusBar(Optional Msg As Variant)
    Dim Temp As Variant
    ' if the Msg variable is omitted or is empty, return the control of the status bar to Access
        If Not IsMissing(Msg) Then
            If Msg <> "" Then
                Temp = SysCmd(acSysCmdSetStatus, Msg)
            Else
                Temp = SysCmd(acSysCmdClearStatus)
            End If
        Else
            Temp = SysCmd(acSysCmdClearStatus)
        End If
End Sub
ksor is offline   Reply With Quote
Old 10-26-2019, 11:00 AM   #7
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,653
Thanks: 58
Thanked 1,459 Times in 1,440 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Get value from record by clicking on it ??

And what do you normally assign to Msg?

__________________
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-26-2019, 12:00 PM   #8
ksor
Newly Registered User
 
Join Date: Feb 2018
Location: Aarhus V, Denmark
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
ksor is on a distinguished road
Re: Get value from record by clicking on it ??

Quote:
Originally Posted by theDBguy View Post
And what do you normally assign to Msg?
The text I want to be seen in the status bar/line - in this case:

DoubleClick on the record you want to copy participants from OR press ENTER to cancel !

When you want to remove the text in the status bar/line you just call the sub with nothing or ""

I think I have the psoudo code now:

1) A pickingFlag is raised when clicking the Copy-button
2) In 2click event do the copying IF the flag is raisea, after copy lower the falg else do nothing
3) If ENTER is pressed while the falg is raised then lower it again

I think that's it - right ?
ksor is offline   Reply With Quote
Old 10-26-2019, 12:03 PM   #9
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,653
Thanks: 58
Thanked 1,459 Times in 1,440 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Get value from record by clicking on it ??

As long as it works. Good luck!

__________________
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
VBA when clicking on record WimDC Modules & VBA 0 03-13-2015 01:26 AM
Record selection in listbox jumps to similar record on clicking edit UnrulyJulie Forms 12 08-15-2014 06:25 AM
Clicking a record on a datasheet form to open the record in a pop-up chrislapz Forms 7 04-23-2013 08:31 AM
Record invisible & open form when clicking record BlueStarBrite Forms 2 02-20-2009 09:00 AM
How to add a record just by clicking CheckBox Tiger Oman Forms 7 05-02-2006 11:20 PM




All times are GMT -8. The time now is 07:49 PM.


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