Date update overflow error ‘6’

Tayl4n

Board Regular
Joined
Feb 17, 2021
Messages
84
Office Version
  1. 2016
Platform
  1. Windows
Dear MrExcel community,
I have a project search & update & add & delete can do.
There are 32 column and 5 of them is date.
When I search date format has changed automatically “dd.mm.yyyy” to “mm/dd/yyyy” and shows up to textbox with that wrong format.
I solved this with this code;

VBA Code:
txtU.Text = Format(txtU, “dd.mm.yyyy”
But this time update functions are broken for date textboxes. When I try to change a date on textbox this error shows up and date changin randomly ex. I press 2 and date changes to “01.01.1900”.
I feel confused. I use these codes for update;
VBA Code:
Sheets(“Worksheet”).Cells(y,1).Value = txtA
 
What problem? typing a 2 in is giving the correct answer... type the full date.
I wrote the problem in my first message.
The problem is; I makin search and get the datas to textboxes. There are 32 column and 5 of them are dates. I want to edit date with textbox and update. But when I press to date’s textbox and want to change date changes to “01.01.1900” and can’t edit.
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
That sounds like a problem with your code, but you haven't posted it, other than one line, so it's very hard to comment.
 
Upvote 0
That sounds like a problem with your code, but you haven't posted it, other than one line, so it's very hard to comment.
Everything is worked clearly before I add this
VBA Code:
txtU.Text = Format(txtU, “dd.mm.yyyy”
This is solve only showing date formats.
I can’t copy paste the all codes because there is no internet connection. I wrote codes with phone and its hard which parts do you need to comment ?
 
Upvote 0
I need to know which event is reformatting the textbox. If it's the Change event, don't use that. Use something like the Exit event of the textbox.
 
Upvote 0
I need to know which event is reformatting the textbox. If it's the Change event, don't use that. Use something like the Exit event of the textbox.
Yes it is work I can change and update but date shows on textbox as this time “mm/dd/yyyy” and it is making possibility to mistake.
 
Upvote 0
You should only need to format it when you load the date into it.
 
Upvote 0
The Format code is fine, it's where you use it that is the problem. It should only be used in the code that populates the textbox initially with the date value and, if necessary, something like the Exit event of your textbox.
 
Upvote 0
The Format code is fine, it's where you use it that is the problem. It should only be used in the code that populates the textbox initially with the date value and, if necessary, something like the Exit event of your textbox.
code didn’t work in exit event also tried before update and after update there is mo results :(
 
Upvote 0
It's impossible for me to help you if I can't see the code you are using, I'm afraid.
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,738
Members
448,988
Latest member
BB_Unlv

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