PC Review


Reply
Thread Tools Rate Thread

Code to look up a number if field is null

 
 
Simon
Guest
Posts: n/a
 
      11th Jun 2009
On load of a form i have a txtUser field

Usally this field is Empty when frmOrder is open, if its Empty i want
code to dispaly the UserID from this form[Forms]![frmMainMenu]!
[txtUserID]

If there is is already a number in txtUser, i do not want any numbers
to be changed and just left the same


Can any one point me in the right way for code?

Thanks

 
Reply With Quote
 
 
 
 
Ken Snell [MVP]
Guest
Posts: n/a
 
      14th Jun 2009
Use the form's Load event to do this:

Private Sub Form_Load()
If Len(Me.txtUser.Value & "") = 0 Then Me.txtUser.Value = _
[Forms]![frmMainMenu]![txtUserID]
End Sub

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


"Simon" <(E-Mail Removed)> wrote in message
news:30794696-7c17-4218-b199-(E-Mail Removed)...
> On load of a form i have a txtUser field
>
> Usally this field is Empty when frmOrder is open, if its Empty i want
> code to dispaly the UserID from this form[Forms]![frmMainMenu]!
> [txtUserID]
>
> If there is is already a number in txtUser, i do not want any numbers
> to be changed and just left the same
>
>
> Can any one point me in the right way for code?
>
> Thanks
>



 
Reply With Quote
 
 
 
 
rosemarie-pc
Guest
Posts: n/a
 
      28th Jun 2009


"Ken Snell [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Use the form's Load event to do this:
>
> Private Sub Form_Load()
> If Len(Me.txtUser.Value & "") = 0 Then Me.txtUser.Value = _
> [Forms]![frmMainMenu]![txtUserID]
> End Sub
>
> --
>
> Ken Snell
> <MS ACCESS MVP>
> http://www.accessmvp.com/KDSnell/
>
>
> "Simon" <(E-Mail Removed)> wrote in message
> news:30794696-7c17-4218-b199-(E-Mail Removed)...
>> On load of a form i have a txtUser field
>>
>> Usally this field is Empty when frmOrder is open, if its Empty i want
>> code to dispaly the UserID from this form[Forms]![frmMainMenu]!
>> [txtUserID]
>>
>> If there is is already a number in txtUser, i do not want any numbers
>> to be changed and just left the same
>>
>>
>> Can any one point me in the right way for code?
>>
>> Thanks
>>

>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convet Null text to null number (help me) =?Utf-8?B?TWFyY28=?= Microsoft Access Queries 2 15th Jun 2007 11:49 AM
If number >8, subtract 8 /if txtlot is null then this is null too =?Utf-8?B?V2FsdGVyIE1pbGxz?= Microsoft Access 4 16th Jan 2006 10:05 PM
Look for NULL Value of a field KIT LAU Microsoft Access 2 25th Aug 2004 06:19 AM
null + number = null Yair Sageev Microsoft Access 2 16th Aug 2004 10:25 PM
Null result when combining null field with non-null field in ADP View Lauren Quantrell Microsoft Access Form Coding 8 17th Nov 2003 03:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:08 AM.