Solved

change label caption in MS Access

Posted on 2010-11-08
6
755 Views
Last Modified: 2012-05-10
I currently have frm_main & frm_incoming

frm_main got 2 buttons:   1. incoming, and 2. outgoing

onClick of incoming, in_or_out (unbound label) =       Me.in_or_out = "incoming"
onClick of outgoing, in_or_out (unbound label) =       Me.in_or_out = "outgoing"

------------------------------------------------------
The problem:
-------------------
on open of frm_incoming:

Private Sub Form_Open(Cancel As Integer)
    If Forms!frm_main!in_or_out = "outgoing" Then
    Me.Label129.Caption = "123"
    End If
End Sub

This code works, but only on the 2nd click of "outgoing" button

Is there a way to get it right from the 1st click?

Thanks
0
Comment
Question by:omanca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 125 total points
ID: 34090492
Maybe try the Form Load event:


Private Sub Form_Load()
    If Forms!frm_main!in_or_out = "outgoing" Then
    Me.Label129.Caption = "123"
    End If
End Sub
0
 
LVL 19

Accepted Solution

by:
MINDSUPERB earned 125 total points
ID: 34090526
If in_or_out is a label, try this code in the current event.

Private Sub Form_Current()
    If Forms!frm_main!in_or_out.Caption = "outgoing" Then
    Me.Label129.Caption = "123"
    End If
End Sub

Sincerely,
Ed
0
 
LVL 2

Author Comment

by:omanca
ID: 34091233
Seems like I had to close the app and re-open it.

It works just fine !!



Thanks guys.
0
 
LVL 2

Author Comment

by:omanca
ID: 34935716
Hi again angellll,

I managed to resolve this.  Please read my comment:

11/09/10 01:15 AM, ID: 34091233


Thanks and regards.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 34941480
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question