Get value from record by clicking on it ?? (1 Viewer)

ksor

Registered User.
Local time
Today, 10:17
Joined
Feb 8, 2018
Messages
70
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" ? :D
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:17
Joined
May 7, 2009
Messages
19,169
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.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:17
Joined
Oct 29, 2018
Messages
21,358
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.
 

ksor

Registered User.
Local time
Today, 10:17
Joined
Feb 8, 2018
Messages
70
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 ?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:17
Joined
Oct 29, 2018
Messages
21,358
Are you using a MsgBox?
 

ksor

Registered User.
Local time
Today, 10:17
Joined
Feb 8, 2018
Messages
70
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:17
Joined
Oct 29, 2018
Messages
21,358
And what do you normally assign to Msg?
 

ksor

Registered User.
Local time
Today, 10:17
Joined
Feb 8, 2018
Messages
70
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 ?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:17
Joined
Oct 29, 2018
Messages
21,358
As long as it works. Good luck!
 

Users who are viewing this thread

Top Bottom