click to auto input

peterjb44

Registered User.
Local time
Today, 14:02
Joined
Mar 7, 2013
Messages
55
Hi all,

could you please help me with a bit of code.

what I would like to happen is when I click on QuoteNeeded (which is a yes/no) it will put active in CusomerActive

also once I have clicked QuoteNeeded it then becomes locked

just in case you need these, the form name is CustomerF and that is on a navigation form called MainF, table name is CustomerT

thanks

peter
 
Assuming 'QuoteNeeded' is a checkbox and 'CusomerActive' a textbox you can use the following code:
Code:
Private Sub QuoteNeeded_AfterUpdate()

    If QuoteNeeded.Value = -1 Then
        CustomerActive.Value = "active"
        QuoteNeeded.Locked = True
    End If
    
End Sub

That's all? Or... am I missing something?

I suppose you have some code that unlocks 'QuoteNeeded' somewhere in your application.

However, stepping forward in the development of your database, you should consider the use of a naming convention. As a start, e.g.

http://www.utteraccess.com/wiki/index.php/Naming_Conventions

Search the internet for "VBA naming conventions" in order to get more information.
 
Hi StarGrabber,

yes that's all, thanks for that works the way I need.

I don't have code that unlocks QuoteNeeded, but would like to be able to at some point (just incase someone clicks QuoteNeeded by mistake), maybe a button that when clicked asks for a password before QuoteNeeded could be unlocked.....is that possible?

thanks for let me know about naming convention, I best sort out my DB and code before I get to much to do

thanks again for helping

peter
 

Users who are viewing this thread

Back
Top Bottom