>Thanks Cetin,
>
>The Client_number from the Combobox(Allocation_Numbers.Client_Number) must also be copied to a textbox(F_Accounts.Client_Number) on the form. This number is always 4 characters long ie 1006. The Client field(Allocation_Numbers.Client) goes to the Controlsource(F_Accounts.Client) Sorry if I did not express it to well in the -A- part.
>
>As for the interactivechange:
>
>The form is related to table F_Accounts. The Depot_Number is always 6 characters long ie 732977. Thus the value for Exp_Alloc_Number will be 1006732977. If I understand it correctly then the second padl will become
>
>padl(F_Accounts.Depot_Number,6,"0") and the first padl will become
>
>padl(F_Accounts.Client,4,"0")
>
>If, when the client in the Combobox is selected ie "Data Processing" and its corresponding Client_Number is written to the Client_Number on the form, would it not be easier to say in the interactivechange
>
>thisform.Exp_Alloc_Number.textbox.value = ;
> thisform.Client + thisform.Depot_Number
>
>or is this DOS type concatenation not on.
>
>Petrus.
Hi Petrus,
I'll try w/o leading any confusion. As I get :
-F_Accounts.Client_Number is the controlsource of the textbox.
-F_accounts is another table, right ? And allocation_numbers is also a table.
-As selection made, allocation_numbers.client -> F_accounts.Client and allocation_numbers.client_number -> F_accounts.Client_number.
If we're OK up to this point, when combo rowsourcetype is fields or alias, as you move in combo, rec pointer moves in combo's rowsource (Allocation_numbers). That means you could either use combo's properties or directly rowsource's (Allocation_numbers) fields. Now if you set controlsource of combo to F_accounts.client_number, in interactivechange, valid or lostfocus (not important for the moment), simply :
replace client ;
with allocation_numbers.client ;
in "F_accounts"
You could do this because rec pointer moved in allocation_numbers to the record with client_number selected. Now their textboxes on form only need a refresh (why you would keep extra textboxes is another discussion).
Depot_number concatanation could be done as you said with a slight modification :
thisform.Exp_Alloc_Number.textbox.value = ;
thisform.Client.value + thisform.Depot_Number.value
thisform.Exp_Alloc_Number.textbox.value = ;
F_accounts.Client + F_Accounts.Depot_Number
Provided they're both char type and have already desired format. Now this one hits to the fact I prefer padl() over transform(). With padl() you could have leading zeros (or other char) w/o thinking type of expression is char or numeric. BTW your padl() are correct. ie:
lnNumber = 3
lcNumber = "3"
? padl(lnNumber,5,"0")
? padl(lcNumber,5,"0")
Using padl() seems to be unnecessary in your case though (but I would use it like that for safety reasons). I hope no confusion.
Cetin