Beginner trying to make a string of text appear with toggles (1 Viewer)

13h0

New member
Local time
Today, 14:52
Joined
Aug 12, 2019
Messages
2
Hello
I am new to microsoft vba and modules and also macros

I am trying to create a form in which i have toggle buttons drop down buttons and also text box in which i am creating to follow a process.

I have created the form as far as needed but i want to go one step further by when ever i use the toggle buttons drop downs and text boxes to create a string of text into its own text box at the bottom of the form

For example
I have a toggle button for security when i click the button i would like it to put text into or delete the text if deselected example of text "security complete"

Drop down to do the same and also text box to input the text into the other text box but all in as 1 complete sentence but there is multiple of toggles that can be used

If you have any questions feel free to ask

Thank you if you understand and are able to help
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:52
Joined
Oct 29, 2018
Messages
21,455
Hi. Welcome to AWF! Can you post the code you have so far? What is actually happening now?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 08:52
Joined
Feb 28, 2001
Messages
27,142
OK, where and how are you trying this?

Normally, people just getting into Access learn about event code and it drives them batty. For at least a while, the problem is knowing which event to select. And that is crucial to the success or failure of your intended endeavor.

Since you are talking about drop-down boxes (combo or list?) you have two very likely choices and a few less likely choices. You could pick the CLICK event that is needed to select one of the drop-down values. If you have a multi-valued list, you might choose the LOST FOCUS event. Other options exist but of diminishing significance.

Posting the code will show us what you are trying and (if you include the entry point declaration) WHEN you are trying it. Those facts will make a difference.
 

Micron

AWF VIP
Local time
Today, 09:52
Joined
Oct 20, 2018
Messages
3,478
You can help us help you by using the correct terms and names. Maybe go into your form in design view and select your controls one by one and note what the property sheet calls them (you might have to open property sheet via the ribbon). I say this because all of the controls don't all have the same events or properties, so it might matter. I suspect your 'toggle' buttons are checkboxes, or maybe even option/radio buttons. Also, if you have several option buttons, they must be contained in a frame for them to work properly, whereas checkboxes do not. Hopefully you can see my point now.
 

Mark_

Longboard on the internet
Local time
Today, 06:52
Joined
Sep 12, 2017
Messages
2,111
In addition to what the others have suggested, I'd like to add one piece of advise that may make your life far easier; have ONE sub that handles the actual formatting, but call it from each of the controls that can affect it.

I'd have it structured so you build the string from nothing each time. This avoids all of the problems with trying to search through the string to find what you had previously put in and remove it.
 

13h0

New member
Local time
Today, 14:52
Joined
Aug 12, 2019
Messages
2
With the toggle its a toggle button so when you press it it goes green

Another way i can maybe explain it is on info path which i have done something similar with is on there i used concat on the textbox which then puts the value one after each other, so what ever is typed in is the value of the text box, the drop down selectuon you choose if the value and i used a tick box on there which has a sentance as the value when pressed, this then meant if its unticked it removed the value from the text box with out deleting the other values which is then copy and pasted

Its all on my work computer so i wont be able to show anything unfortunately but its just a little side project i am doing to try make my life easier and quicker
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:52
Joined
Aug 30, 2003
Messages
36,124
You can add a value with:

Me.TextboxName = Me.TextboxName & "the text you want to add"

you could delete it with something like

Me.TextboxName = Replace(Me.TextboxName, "the text you want to add", "")
 

Users who are viewing this thread

Top Bottom