If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
combobox
here it is..
Private Sub Command41_Click() Client = Me.ClientCombo.Value dureeTOTAL = DLookup("TOTAL", "client_total", "Client='" & Client & "'") Me.txtdureeTOTAL.Value = dureeTOTAL 'RECHERCHER LA DATE DE FABRICATION dateDebutfab = DLookup("DB", "client_date", "Client='" & Client & "'") dateFinfab = DLookup("DF", "client_date", "Client='" & Client & "'") Me.txtdatefab.Value = dateDebutfab & " Ã* " & dateFinfab 'RECHERCHER L'HEURE TOTALE DE PRODUCTION SUIVANT LES CLIENTS prodTOTAL = DLookup("TOTAL", "client_tache", "Client='" & Client & "' AND numT=1") 'prodTOTAL1 = DLookup("TOTAL", "MOCN_total", "Client='" & Client & "'") 'prodTOTAL2 = DLookup("TOTAL", "client_total", "Client='" & Client & "'") Me.txtprod.Value = prodTOTAL 'RECHERCHER L'HEURE TOTALE DE NON PRODUCTION SUIVANT LES CLIENTS nonprodTOTAL = DLookup("TOTAL", "client_tache", "Client='" & Client & "' AND numT=2") Me.txtnonprod.Value = nonprodTOTAL 'CALCULER LE TRP DE PRODUCTION Me.txtTRP.Value = (prodTOTAL / dureeTOTAL) 'CALCULER LE NON TRP Me.txtNONTRP.Value = (nonprodTOTAL / dureeTOTAL) 'RECHERCHER LE TONNAGE POUR CHAQUE CLIENT ET CALCULER HEURE/TONNE tonnage = DLookup("Tonnage", "client_tonnage", "Client='" & Client & "'") Me.txt_tonnage.Value = (dureeTOTAL / tonnage) 'If (Me.txtNONTRP.Value = Null) Then Me.txtNONTRP.Value = 0 End Sub i dont know is this helpful.. thank you in advance. "John W. Vinson" wrote: On Wed, 15 Apr 2009 15:21:01 -0700, MS wrote: Thank you for your reply, but i dont think its because of bound or unbound control. I have changed it to unbound but that doesn't change anything, the name still replace with another one in the combo list.. Do you have any other idea? thank you.. Care to post your code? It's a bit hard to debug it without seeing it. Indicating the Control Source, Rowsource, and Bound Column of the combo should help too. -- John W. Vinson [MVP] |
#12
|
|||
|
|||
combobox
HI, does any one can help me? I want to make appear the value 0 when its null. How can i write the code in VBA? i tried this one but nothing happens. Your help will very much appreciated. If prod_TOTAL = Null Then Me.txt_Prod.Value = "0" End If |
#13
|
|||
|
|||
combobox
On Thu, 16 Apr 2009 02:43:01 -0700, MS wrote:
HI, does any one can help me? I want to make appear the value 0 when its null. How can i write the code in VBA? i tried this one but nothing happens. Your help will very much appreciated. If prod_TOTAL = Null Then Me.txt_Prod.Value = "0" End If Null is a funny beast. It means "undefined, unknown, unspecified". As such nothing is equal to NULL, or for that matter unequal to NULL - you don't know what it is, so there's no way to decide! The solution is to use either the NZ - Null To Zero - function, or the IsNull() function: Me.txt_Prod= NZ(prod_TOTAL, "0") will return a text string zero to the txt_PROD control (if the field is numeric rather than text, leave off the quote marks). In other cases you can use the IsNull() VBA function: If IsNull(prod_TOTAL) Then do something Else do something else End If This will only work if prod_TOTAL is a Variant (a datatype which accepts nulls). -- John W. Vinson [MVP] |
#14
|
|||
|
|||
LOOP NOT INITIALIZED
HI, can somebody please help me. Every time I want to create a subform in a form a notice pop out, it says: For loop not initialized. I don't know why is this happening so suddenly but i cannot make subforms that i want. The same thing happens when i click on analyze in the ribbon. Your help will be much appreciated. |
#15
|
|||
|
|||
dOES yOUR sHIFT kEY wORK?
For X = SomeValue (Down/)To SomeOtherValue
HTH -- -Larry- -- "MS" wrote in message ... HI, can somebody please help me. Every time I want to create a subform in a form a notice pop out, it says: For loop not initialized. I don't know why is this happening so suddenly but i cannot make subforms that i want. The same thing happens when i click on analyze in the ribbon. Your help will be much appreciated. |
#16
|
|||
|
|||
dOES yOUR sHIFT kEY wORK?
Im sorry, i dont understand what are you trying to say.. Could you specify me more about it? Thank you "Larry Daugherty" wrote: For X = SomeValue (Down/)To SomeOtherValue HTH -- -Larry- -- "MS" wrote in message ... HI, can somebody please help me. Every time I want to create a subform in a form a notice pop out, it says: For loop not initialized. I don't know why is this happening so suddenly but i cannot make subforms that i want. The same thing happens when i click on analyze in the ribbon. Your help will be much appreciated. |
#17
|
|||
|
|||
dOES yOUR sHIFT kEY wORK?
Look in Help for "For ... Next". Help is where I found soooo many
"secrets". example: dim x as integer For x = 1 to 10 do something next HTH -- -Larry- -- "MS" wrote in message ... Im sorry, i dont understand what are you trying to say.. Could you specify me more about it? Thank you "Larry Daugherty" wrote: For X = SomeValue (Down/)To SomeOtherValue HTH -- -Larry- -- "MS" wrote in message ... HI, can somebody please help me. Every time I want to create a subform in a form a notice pop out, it says: For loop not initialized. I don't know why is this happening so suddenly but i cannot make subforms that i want. The same thing happens when i click on analyze in the ribbon. Your help will be much appreciated. |
|
Thread Tools | |
Display Modes | |
|
|