cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TimoMigchielsen
Post Prodigy
Post Prodigy

Seperating a textbox into 3 textboxes

HAS BEEN SOLVED BY MYSELF

I am having 3 editable textboxes and 1 only viewable textbox. Whenever you fill in these 3 textboxes it will combine these 3 textboxes and put a - between the first and second box and a _ between second and third box. Example: 00000-00_0000

Now I also have a QR code scanner which is supposed to automatically fill in the only viewable textbox. Whenever the only viewable textbox has been filled by the scanner, I want it to automatically seperate this information into the 3 textboxes. First 5 numbers are in the first textbox. the 7th and 8th number will be the middle textbox and the last 4 numbers will be the last textbox. Now I want to be able to combine these 2 things. Being able to scan and being able to fill it in by hand.

A screenshot on how it looks:
https://gyazo.com/d26424d1eed490a9c06e450d650be0ee

Code of the 3 top textboxes:

If(
EditForm.Mode=FormMode.New,
ResetValue,
Ordernummer
)

If(
EditForm.Mode=FormMode.New,
ResetValue,
Deelorder
)

If(
EditForm.Mode=FormMode.New,
ResetValue,
Tekeningnummer
)

Code of the only viewable textbox (I see I currently have it editable). I have tried to combine these 2 but they do not work sadly.

BarcodeScanner2.Value &
DataCardValue21 & If(!IsBlank(DataCardValue11),"-") & DataCardValue11 & If(!IsBlank(DataCardValue22),"_") & DataCardValue22

Code of the QR scanner to seperate the values, what I've tried:
Set(first5,Left(BarcodeScanner1.Value,5));
Set(middle2,Right(Left(BarcodeScanner1.Value,8),2));
Set(last4,Right(BarcodeScanner1.Value,4));

1 REPLY 1
Pranav_Shroti
Kudo Collector
Kudo Collector

I tried following and I was able to successfully.

1. Declare Three Variables on Form-

OnVisible  = Set(varFirst, "1234"); Set(varSecond, "111"); Set(varThree, "22"); 

You can opt to keep the default blank.

 

2. Text box properties- 

Text1.Default = varFirst;

Text1.OnChange = Set (varFirst, Text1.Text);

 

Text2.Default = varSecond;

Text2.OnChange = Set (varSecond, Text2.Text);

 

Text3.Default = varThree;

Text3.OnChange = Set (varThree, Text3.Text);

 

This will allow your values to be updated in Barcode Label when you make manual changes to text boxes.

 

3. Set the desired format in Barcode Label

Label1.Text = Concatenate(varFirst, "-", varSecond, "_", varThree);

 

4. BarCode Control OnChange you now have to SPLIT the read barcode and set it into varFirst, varSecond, varThree. 

I was not able to test this out on my mobile device however should work.

 

Cheers !

Pranav

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,965)