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 |
#1
|
|||
|
|||
Setting default value of control on form to the value of another c
I am trying to set the default value of a control named DelAddr1 to the value
of another control on hte same form called CustAddr1. The form is called Invoices. I've tried setting the dfault value of DelAddr1 to: =[CustAddr1] =![Invoices]![CustAddr1] CustAddr1 has a tab stop number lower than DelAddr1 -- Marg |
#2
|
|||
|
|||
Setting default value of control on form to the value of another c
Marg,
Not sure why you're doing that, but... using the AfterUpdate event of CustAddr1 .... Private Sub CustAddr1_AfterUpdate() DelAddr1.DefaultValue = " ' " & [CustAddr1] & " ' " End Sub (I put spaces between the quotes for clarity... remove them in the final code) -- hth Al Campagna Microsoft Access MVP http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." "Marg" wrote in message ... I am trying to set the default value of a control named DelAddr1 to the value of another control on hte same form called CustAddr1. The form is called Invoices. I've tried setting the dfault value of DelAddr1 to: =[CustAddr1] =![Invoices]![CustAddr1] CustAddr1 has a tab stop number lower than DelAddr1 -- Marg |
#3
|
|||
|
|||
Setting default value of control on form to the value of another c
The timing won't allow you to do it this way: Access applies the Default
Value as soon as you move to the new record. At that stage, you have not entered the value of CustAddr1, so it cannot assign that value to DelAddr1. Use the AfterUpdate event procedure of CustAddr1 to programmatically assign the value to DelAddr1 also. The code for the event procedure will look like this: Private Sub CustAddr1_AfterUpdate() Me.DelAddr1 = Me.CustAddr1 End Sub -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Marg" wrote in message ... I am trying to set the default value of a control named DelAddr1 to the value of another control on hte same form called CustAddr1. The form is called Invoices. I've tried setting the dfault value of DelAddr1 to: =[CustAddr1] =![Invoices]![CustAddr1] CustAddr1 has a tab stop number lower than DelAddr1 -- Marg |
Thread Tools | |
Display Modes | |
|
|