userform to update only changed textboxes

littlepete

Well-known Member
Joined
Mar 26, 2015
Messages
507
Office Version
  1. 365
Platform
  1. Windows
Hello :)

On my userform i can watch or change all textboxes. if i click the update button, all (!!!) textboxes are stored in the database,
whether they changed or not change...

how can i make it happen that after changing a few textboxes, only those changed textboxes are updated to the database
when i click the update button :) ?

thank you so much for helping :) !!!
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
In the macros for your UF, those of the type Textbox..Change, do just checking if the entered values are okay, but don't update to your database. Move that part to the macro of your commandbutton.
 
Upvote 0
In the macros for your UF, those of the type Textbox..Change, do just checking if the entered values are okay, but don't update to your database. Move that part to the macro of your commandbutton.
hello :)

so, in the vba of my update commandbutton i should add the check if certain textboxes changed?

i have 29 textboxes, each has this similar line:
VBA Code:
Sheets("gegevens").Range("l" & dezerij).Value = ufpersonenfiche.pftitel.Text

how can i add something like if userform.title.text = ... (true? something else?)

thx !!!
 
Upvote 0
For every individual textbox, when you change something, you can check if that value is okay.
Suppose you except a number and you enter a string, ... , you can give a warning.

Finally, when all your 28 textboxes are okay and you hit the commandbutton, you can do that without hesitating.

It's too late to modify your program i think, but with lots of textboxes, you can call in a classmodule, but i think that is a level to high for this. Otherwise if there are a lot of similar textboxes, you can write one parametered macro and call that one with your data ... etc etc.
 
Upvote 0
For every individual textbox, when you change something, you can check if that value is okay.
Suppose you except a number and you enter a string, ... , you can give a warning.

Finally, when all your 28 textboxes are okay and you hit the commandbutton, you can do that without hesitating.

It's too late to modify your program i think, but with lots of textboxes, you can call in a classmodule, but i think that is a level to high for this. Otherwise if there are a lot of similar textboxes, you can write one parametered macro and call that one with your data ... etc etc.
hello ;)

i want only to check if the textbox has been changed (from null to anything, or from anything to something else, or from anything to null) ... i tried " = true " in textboxx.change but that's not good...
what should i write, not to see if it's a good value, but if something changed? ...
 
Upvote 0

Forum statistics

Threads
1,223,895
Messages
6,175,257
Members
452,625
Latest member
saadat28

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top