[AccessD] Setting default value of a text box

Stuart McLachlan stuart at lexacorp.com.pg
Tue Apr 2 16:13:28 CDT 2013


That will always return Null since the Default Value is created in the textbox of a new record 
before any user selection takes place.

You need to put code to specifically set the actual value in an event that triggers after the 
selection is made in the Listbox.  Possibly

Sub On_txtInvoiceEnter()
txtInvoice = IIf([CompanyName].[Value]="Renegade","RWLS",Null)
End Sub



On 2 Apr 2013 at 14:49, Kaup, Chester wrote:

> I have a data entry form. The first entry is a list box where the user
> selects a company name. List box name is companyname. The next data
> entry is an invoice number. I am trying to set the default value
> property of the text box using the following statement. The default
> value is not becoming part of the saved data. Thanks for the help 
> 
> =IIf([CompanyName].[Value]="Renegade","RWLS",Null)
> 
> I also tried
> =IIf([CompanyName]="Renegade","RWLS",Null)
> 
> Do I maybe need to set it using code in the after update event of the list box?
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list