Switching text on a command button

B

Bazmac

Hi All,

Is it possible to have a command button on form 1 that when pressed opens
form 2, and displays 1 of 3 captions that are dependent on a text box in form
2.

Form 1 = "Customer_Scheduling" with command button to display "Stock
Available", "Part Stock" and "No Stock"
This command button opens form 2 ("Allocated_Stock")

Form 2 = "Allocated_Stock" with text box, Dropdown selection of "Stock
Available", "Part Stock" and "No Stock".

Thanking you in advance
Bazmac
 
A

Al Campagna

Bazmac,
Yes, it's possible, but I'm not sure why that's necessary, just to open
a form.

If Form2 is based on a table or query, (ex. tblTwo) and has multiple
records,
which record does form1 button want to get it's caption (combo value) from?

If Form2 is based on only one record, (ex. tblTwo) that changes from
time
to time, then you'll have to do a DLookup for the tblTwo combo value when
Form1
opens, and use that value as your button caption. Also, you'll need to
change
the button caption whenever the combo value changes. (combo AfterUpdate)
--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
B

Bazmac

Al,

Thanks for your reply.

The reasoning behind the 3 captions is that form1 "Customer_Scheduling" is
where I program the coming weeks work, the command button caption is to
notify me of the stock delivery status, as I can't schedule a customer unless
all thier allocated has been delivered.

Trust that this makes sense.

Bazmac
 
B

Bazmac

Thanks Al,

Your answer gave the direction that I needed, I am now on the way of
achieving the desired outcome

Thanks for your help

Bazmac
 
B

Bazmac

Al,

I have been playing around with this and have a simpler approach, using
conditional formatting with a textbox and colours in lue of the 3 lines of
text, I have this working fine.

As my main form "Customer_Scheduling" (a contiuous form) is getting a bit
tight for room I would like to add text ("Stock") to the textbox using the
same criteria that enables the "Exit" button on the "Allocated_Stock" form.

'From Form "Allocated_Stock"
Private Sub Form_Current()
If IsNull(Me.Stock_Available) Then
Me.Exit.Enabled = False
Else
Me.Exit.Enabled = True
End If

End Sub

This is also the AfterUpdate() event of textbox "Stock_Available_"

Form "Customer_Scheduling" has record source as "QryCustomer_Edit" which
relates to "TblCustomers", form "Allocated_Stock" has record source as
"TblCustomers".

Thanking You
Bazmac
 
S

Sandra Watmough

Bazmac said:
Thanks Al,

Your answer gave the direction that I needed, I am now on the way of
achieving the desired outcome

Thanks for your help

Bazmac
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top