PC Review


Reply
Thread Tools Rate Thread

code on text box

 
 
Nick T
Guest
Posts: n/a
 
      29th Oct 2008
Hi,

Any suggestions on code which would work for the following:
I have two text boxes - "TextA" & "TextB". can i put some code some where
which will carry out a set function eg. close my db.

ie, When "TextA" = "TextB" Me.Application.CloseCurrentDatabase

???any suggestions

Basically, when one text box equals another text box, my database closes??
Where would i put the code and any suggestions what code i could try.

Any suggestions greatly appreciated.

 
Reply With Quote
 
 
 
 
S.Clark
Guest
Posts: n/a
 
      29th Oct 2008
In the AfterUpdate of both of the textboxes call a proc like: IsValidToClose()

Sub IsValidToClose()
If me.txtA & "" = me.txtB & "" then
Me.Application.CloseCurrentDatabase
end if
End Sub

It won't be as simple as this, because you'll encounter a few issues, like
forms closing in an updated state, so you'll just have to figure out the
little inconvienances. But focus on the principle of it.

The & "" is to avoid having errors with Null values.

Steve Clark
Access MVP '00-'05
Twin Soft
www.twin-soft.com

"Nick T" wrote:
> Hi,
>
> Any suggestions on code which would work for the following:
> I have two text boxes - "TextA" & "TextB". can i put some code some where
> which will carry out a set function eg. close my db.
>
> ie, When "TextA" = "TextB" Me.Application.CloseCurrentDatabase
>
> ???any suggestions
>
> Basically, when one text box equals another text box, my database closes??
> Where would i put the code and any suggestions what code i could try.
>
> Any suggestions greatly appreciated.
>

 
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
Macro - Fixed text code needs replacing with variable text steven.holloway Microsoft Excel Misc 3 22nd Jul 2008 03:57 PM
Convert a Number Code to a Text Code =?Utf-8?B?VHJheWU=?= Microsoft Excel Misc 3 6th Apr 2007 09:54 PM
How can I see a text code, such as the code for 'line return'? =?Utf-8?B?QmxhY2toYXdr?= Microsoft Word Document Management 3 26th Jan 2006 09:15 PM
Changing a text boxes value (from code) of a data bound text box does not work Joshua Ellul Microsoft ADO .NET 2 17th Oct 2003 01:03 AM
Changing a text boxes value (from code) of a data bound text box does not work Joshua Ellul Microsoft Dot NET 0 15th Oct 2003 06:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:27 AM.