Problems with DTPicker control

Closed
mc27 Posts 1 Registration date Tuesday May 4, 2010 Status Member Last seen May 5, 2010 - May 5, 2010 at 04:54 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - May 5, 2010 at 08:31 AM
Hello,

I want to create a userform and I have some issues - I hope that I can find any help here.Thank you.


1. DTPicker Control.
1.1 How can I empty this control ? If I'm writing code in formular for empting the control, i am receiving this error : "Run-time error 35787. Can't set Value to NULL when checkbox property = FALSE".
1.2 How can I modify this control ? I I'm writing code in modul for modifing the control, i am receiving this error : "Run-time error 35788 . An error occured in a call to the Windows Date and Time Picker control".

2. In Page 2 of the formular, tabel "PAYMENT TERMS", column "Payment Procent %".No mather how many payment terms are inserted ( maximum 3), the sum of the procent must be 100 %. During completing the form, can I apply a check-in for this sum of the procents inserted ? In case that the sum is not 100%, the user should not be allowed to add the all infos and to receive a warning message : "The sum for payment terms procents is not 100 - IT MUST BE 100!!!"

3. Combobox "Payment Method" I have defined a namerange for rowsource.Even like this, in the form I can choose witch option I want, but in the same time I can insert whatever text I want.How can I force to complete obly from the drop-list of the combobox ?

4. In Page 1, article table.
4.1In sheet " Article's list" there is a table with info for each article.
In form, user must select only the name of the article, and the rest of the info to be populated automaticaly in the controls specific to the columns : Code, Packing Method, Price List, Currency.The rest of the columns ( Quantity, Special Price, Special Currency Price , Discount ) must be inserted manualy in the form.I can apply a lookup function in the sheet, but how can I applied in the form ? It will be much easy for an user when he is completing the form.
4.2 When the user is inserting data's in the discount column, I want to apply a checkin for discount : if the discount inserted in the form is greater than the discount in the sheet "Article's list", the user to receive only a notification : The discount inserted is greater then the discount list from data-base for this article" .
4.3 The same check in for the "Special Price" column : if the user is inserting a price that it is greater then the price list with discount, to notify the user with a message : "The special price is greater than the price list with discount" .

5. In each table, in column "Current No" how can I create a function who will insert automaticaly the number of the line ? I am thinking like this : for payment terms table, when I am completing the first line of the Procent % column, the number of the line to be inserted automaticaly as 1, in the the second line as 2 and in the third one as 3.

This is my code :
1. For userform :
Private Sub cmdAdauga_Click()
'scrie valorile in celula definita de mine
With ThisWorkbook.Worksheets("General Order")
.Range("B28").Value = NrCrtPaymentTerms1.Value
.Range("B29").Value = NrCrtPaymentTerms2.Value
.Range("B30").Value = NrCrtPaymentTerms3.Value
.Range("C28").Value = Me.txtProcentPayment1.Value
.Range("C29").Value = Me.txtProcentPayment2.Value
.Range("C30").Value = Me.txtProcentPayment3.Value
.Range("D29").Value = PaymentDate1.Value
.Range("D30").Value = PaymentDate2.Value
.Range("D31").Value = PaymentDate3.Value
.Range("E28").Value = Payment1.Value
.Range("E29").Value = Payment2.Value
.Range("E30").Value = Payment3.Value
.Range("F28").Value = txtGarantie1.Value
.Range("F29").Value = txtGarantie2.Value
.Range("F30").Value = txtGarantie3.Value
.Range("A47").Value = NrCrtArticol1.Value
.Range("A48").Value = NrCrtArticol2.Value
.Range("A49").Value = NrCrtArticol3.Value
.Range("A50").Value = NrCrtArticol4.Value
.Range("A51").Value = NrCrtArticol5.Value
.Range("A52").Value = NrCrtArticol6.Value
.Range("B47").Value = Me.txtCodArticolNav1.Value
.Range("B48").Value = Me.txtCodArticolNav2.Value
.Range("B49").Value = Me.txtCodArticolNav3.Value
.Range("B50").Value = Me.txtCodArticolNav4.Value
.Range("B51").Value = Me.txtCodArticolNav5.Value
.Range("B52").Value = Me.txtCodArticolNav6.Value
.Range("C47").Value = DenumireArticol1.Value
.Range("C48").Value = DenumireArticol2.Value
.Range("C49").Value = DenumireArticol3.Value
.Range("C50").Value = DenumireArticol4.Value
.Range("C51").Value = DenumireArticol5.Value
.Range("C52").Value = DenumireArticol6.Value
.Range("G47").Value = Me.txtAmbalaj1.Value
.Range("G48").Value = Me.txtAmbalaj2.Value
.Range("G49").Value = Me.txtAmbalaj3.Value
.Range("G50").Value = Me.txtAmbalaj4.Value
.Range("G51").Value = Me.txtAmbalaj5.Value
.Range("G52").Value = Me.txtAmbalaj6.Value
.Range("J47").Value = Me.txtCantitate1.Value
.Range("J48").Value = Me.txtCantitate2.Value
.Range("J49").Value = Me.txtCantitate3.Value
.Range("J50").Value = Me.txtCantitate4.Value
.Range("J51").Value = Me.txtCantitate5.Value
.Range("J52").Value = Me.txtCantitate6.Value
.Range("K47").Value = Me.txtPret1.Value
.Range("K48").Value = Me.txtPret2.Value
.Range("K49").Value = Me.txtPret3.Value
.Range("K50").Value = Me.txtPret4.Value
.Range("K51").Value = Me.txtPret5.Value
.Range("K52").Value = Me.txtPret6.Value
.Range("L47").Value = Me.txtMonLista1.Value
.Range("L48").Value = Me.txtMonLista2.Value
.Range("L49").Value = Me.txtMonLista3.Value
.Range("L50").Value = Me.txtMonLista4.Value
.Range("L51").Value = Me.txtMonLista5.Value
.Range("L52").Value = Me.txtMonLista6.Value
.Range("M47").Value = Me.txtPretPref1.Value
.Range("M48").Value = Me.txtPretPref2.Value
.Range("M49").Value = Me.txtPretPref3.Value
.Range("M50").Value = Me.txtPretPref4.Value
.Range("M51").Value = Me.txtPretPref5.Value
.Range("M52").Value = Me.txtPretPref6.Value
.Range("N47").Value = Me.txtMonPref1.Value
.Range("N48").Value = Me.txtMonPref2.Value
.Range("N49").Value = Me.txtMonPref3.Value
.Range("N50").Value = Me.txtMonPref4.Value
.Range("N51").Value = Me.txtMonPref5.Value
.Range("N52").Value = Me.txtMonPref6.Value
.Range("O47").Value = Me.txtDiscount1.Value
.Range("O48").Value = Me.txtDiscount2.Value
.Range("O49").Value = Me.txtDiscount3.Value
.Range("O50").Value = Me.txtDiscount4.Value
.Range("O51").Value = Me.txtDiscount5.Value
.Range("O52").Value = Me.txtDiscount6.Value

End With

'acum se golesc controalele

NrCrtPaymentTerms1.Value = ""
NrCrtPaymentTerms2.Value = ""
NrCrtPaymentTerms3.Value = ""
txtProcentPayment1.Value = ""
txtProcentPayment2.Value = ""
txtProcentPayment3.Value = ""
Payment1.Value = ""
Payment2.Value = ""
Payment3.Value = ""
txtGarantie1.Value = ""
txtGarantie2.Value = ""
txtGarantie3.Value = ""
Unload Me
Exit Sub

err:
MsgBox err.Description, vbOKOnly + vbInformation, "Eroare"
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub


For modul :
Sub Comanda()
frmComanda.Show
End Sub
Sub ModificaComanda()
With ThisWorkbook.Worksheets("Comanda Generala")
frmComanda.DenumireArticol1.Value = .Range("C47").Value
frmComanda.DenumireArticol2.Value = .Range("C48").Value
frmComanda.DenumireArticol3.Value = .Range("C49").Value
frmComanda.DenumireArticol4.Value = .Range("C50").Value
frmComanda.DenumireArticol5.Value = .Range("C51").Value
frmComanda.DenumireArticol6.Value = .Range("C52").Value
frmComanda.txtCantitate1.Value = .Range("J47").Value
frmComanda.txtCantitate2.Value = .Range("J48").Value
frmComanda.txtCantitate3.Value = .Range("J49").Value
frmComanda.txtCantitate4.Value = .Range("J50").Value
frmComanda.txtCantitate5.Value = .Range("J51").Value
frmComanda.txtCantitate6.Value = .Range("J52").Value
frmComanda.txtPret1.Value = .Range("K47").Value
frmComanda.txtPret2.Value = .Range("K48").Value
frmComanda.txtPret3.Value = .Range("K49").Value
frmComanda.txtPret4.Value = .Range("K50").Value
frmComanda.txtPret5.Value = .Range("K51").Value
frmComanda.txtPret6.Value = .Range("K52").Value
frmComanda.txtMonLista1.Value = .Range("L47").Value
frmComanda.txtMonLista2.Value = .Range("L48").Value
frmComanda.txtMonLista3.Value = .Range("L49").Value
frmComanda.txtMonLista4.Value = .Range("L50").Value
frmComanda.txtMonLista5.Value = .Range("L51").Value
frmComanda.txtMonLista6.Value = .Range("L52").Value
frmComanda.txtPretPref1.Value = .Range("M47").Value
frmComanda.txtPretPref2.Value = .Range("M48").Value
frmComanda.txtPretPref3.Value = .Range("M49").Value
frmComanda.txtPretPref4.Value = .Range("M50").Value
frmComanda.txtPretPref5.Value = .Range("M51").Value
frmComanda.txtPretPref6.Value = .Range("M52").Value
frmComanda.txtMonPref1.Value = .Range("N47").Value
frmComanda.txtMonPref2.Value = .Range("N48").Value
frmComanda.txtMonPref3.Value = .Range("N49").Value
frmComanda.txtMonPref4.Value = .Range("N50").Value
frmComanda.txtMonPref5.Value = .Range("N51").Value
frmComanda.txtMonPref6.Value = .Range("N52").Value
frmComanda.txtDiscount1.Value = .Range("O47").Value
frmComanda.txtDiscount2.Value = .Range("O48").Value
frmComanda.txtDiscount3.Value = .Range("O49").Value
frmComanda.txtDiscount4.Value = .Range("O50").Value
frmComanda.txtDiscount5.Value = .Range("O51").Value
frmComanda.txtDiscount6.Value = .Range("O52").Value
End With

frmComanda.cmdAdauga.Caption = "Modifica"
frmComanda.Show
End Sub
Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
May 5, 2010 at 08:31 AM
Could you please upload a sample file with sample data etc on some shared site like https://authentification.site and post back here the link to allow better understanding of how it is now and how you foresee.
0