PDA

View Full Version : Multipage: When I change the page the date changes.



Zeca
04-05-2018, 08:42 AM
In a UserForm I have a Multipage.

Page 1 = CustomerInformataionPage, contains:
Text Box with Customer Data and Events
Combo Box with type of Service

DTPickerStart and DTPickerEnd
ListViewSearch
=========*** =========
Page 2 = InvoiceDescription, containing:
6 Boxes of Text to describe the type of work was done
1 text box for comments.
Buttons:

Save / New - UpDate - ClearForm - Search.

The above code sends the information to the spreadsheet.
============== *** ===========
When doing Search with CURSOR on the Page 1 = CustomerInformataionPage
the information appears in the listView and with a double click on the line
all the objects are filled correctly.

UNTIL HERE IT WORKS PERFECTLY.

============== *** ===========
Beginning of the problem.


1. When making change on Page 1 = CustomerInformataionPage
and without leaving Page1. When I click on button UpDate, the
DTPickerStart and DTPickerEnd, change the date for today date.

2. By clicking on Page 2 = InvoiceDescription or any other Page the

DTPickerStart and DTPickerEnd, change the date for 12/30/1899

Zeca
04-05-2018, 10:13 AM
I found the solution on mrexcel.com. Clicking at "UpDate Button" with Multipage2 activated the DTPickerStart and DTPickerEnd changed dates. Here is the solution:

Private Sub cmdBack_Click ()
Dim intPage As Integer
intPage = MultiPage1.Value
Of
intPage = intPage - 1
If intPage = 0 Then Exit Do
Loop While Not MultiPage1.Pages (intPage) .Enabled
MultiPage1.Value = intPage
End Sub