DT Picker

M

matthew.dalton

Hello all,

I have created a userform with a DT picker. The problem I am having is
that I am trying to make the user enter a date using the date picker
by using a blnvalid code. It seems to work fine with everything else
but not with the DT picker. Any ideas?
 
R

RB Smissaert

Not sure how your datepicker is done, but I would go with the Monthview
control that comes with Microsoft Windows Common Controls-2 6.0
It will save you all the validating and it is easy for the user as well.

RBS
 
M

matthew.dalton

Post your code Boolean Validation code should not be a problem






- Show quoted text -

Private Sub Ok_Click()
Dim BlnValid As Boolean
BlnValid = True
If PortfolioName.Value = "" Or _
ContractualParty.ListIndex < 0 Or _
TypeOfCredit.ListIndex < 0 Or _
Vendor.ListIndex < 0 Or _
ClientCode.ListIndex < 0 Or _
DTPicker1.Enabled = False Or _
Category.ListIndex < 0 Or _
TypeOfContract.ListIndex < 0 Or _
UID.Value = "" Or _
Debts.Value = "" Or _
FaceValue.Value = "" Or _
AcquisitionCost.Value = "" Or _
Owner.ListIndex < 0 Or _
CurrencyBox.ListIndex < 0 Or _
FirstYearCash.Value = "" Or _
Year2Decay.Value = "" Or _
Year3Decay.Value = "" Or _
Year4Decay.Value = "" Or _
Year5Decay.Value = "" Or _
Year6Decay.Value = "" Or _
Year7Decay.Value = "" Or _
Year8Decay.Value = "" Or _
Year9Decay.Value = "" Or _
Year10Decay.Value = "" Then
BlnValid = False
MsgBox ("You must complete all sections with white boxes."),
vbCritical, "Error"
End If
If BlnValid Then Update
End Sub
 
M

matthew.dalton

Post your code Boolean Validation code should not be a problem






- Show quoted text -

Private Sub Ok_Click()
Dim BlnValid As Boolean
BlnValid = True
If PortfolioName.Value = "" Or _
ContractualParty.ListIndex < 0 Or _
TypeOfCredit.ListIndex < 0 Or _
Vendor.ListIndex < 0 Or _
ClientCode.ListIndex < 0 Or _
DTPicker1.Enabled = False Or _
Category.ListIndex < 0 Or _
TypeOfContract.ListIndex < 0 Or _
UID.Value = "" Or _
Debts.Value = "" Or _
FaceValue.Value = "" Or _
AcquisitionCost.Value = "" Or _
Owner.ListIndex < 0 Or _
CurrencyBox.ListIndex < 0 Or _
FirstYearCash.Value = "" Or _
Year2Decay.Value = "" Or _
Year3Decay.Value = "" Or _
Year4Decay.Value = "" Or _
Year5Decay.Value = "" Or _
Year6Decay.Value = "" Or _
Year7Decay.Value = "" Or _
Year8Decay.Value = "" Or _
Year9Decay.Value = "" Or _
Year10Decay.Value = "" Then
BlnValid = False
MsgBox ("You must complete all sections with white boxes."),
vbCritical, "Error"
End If
If BlnValid Then Update
End Sub
 
M

Mike

DTPicker1.Enabled = True

Private Sub Ok_Click()
Dim BlnValid As Boolean
BlnValid = True
If PortfolioName.Value = "" Or _
ContractualParty.ListIndex < 0 Or _
TypeOfCredit.ListIndex < 0 Or _
Vendor.ListIndex < 0 Or _
ClientCode.ListIndex < 0 Or _
DTPicker1.Enabled = False Or _
Category.ListIndex < 0 Or _
TypeOfContract.ListIndex < 0 Or _
UID.Value = "" Or _
Debts.Value = "" Or _
FaceValue.Value = "" Or _
AcquisitionCost.Value = "" Or _
Owner.ListIndex < 0 Or _
CurrencyBox.ListIndex < 0 Or _
FirstYearCash.Value = "" Or _
Year2Decay.Value = "" Or _
Year3Decay.Value = "" Or _
Year4Decay.Value = "" Or _
Year5Decay.Value = "" Or _
Year6Decay.Value = "" Or _
Year7Decay.Value = "" Or _
Year8Decay.Value = "" Or _
Year9Decay.Value = "" Or _
Year10Decay.Value = "" Then
BlnValid = False
MsgBox ("You must complete all sections with white boxes."),
vbCritical, "Error"
End If
If BlnValid Then Update
End Sub
 
M

matthew.dalton

DTPicker1.Enabled = True






- Show quoted text -

All that does is check whether the DTPicker is enabled. What I want it
to do is force the user to pick a date. There is the possibility of
using a check box on the DTPicker if anyone knows how to setup a
Blnvalid based on that?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top