User Profile

Collapse

Profile Sidebar

Collapse
Merlene
Merlene
Last Activity: Mar 15 '19, 06:03 PM
Joined: Sep 25 '18
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Merlene
    replied to Setting controlsource to Dlookup
    It worked! Thanks so much for your patience and again I apologize for not being clear from the beginning! My code is now:

    Code:
    Private Sub Form_Load()
    
        If GetQuarter() = 4 Then
            Me.txtPreviousActionPlan1.ControlSource = "Q3Milestone1"
     
        End If
    
    End Sub
    See more | Go to post
    Last edited by twinnyfo; Oct 29 '18, 11:11 AM. Reason: please use code tags when posting code

    Leave a comment:


  • Merlene
    replied to Setting controlsource to Dlookup
    My apologies for the confusion.
    - The record source for my form is from a query : Qry_UpdateWL
    - I am attempting to change the control source of the textbox : txtPreviousActi onPlan1
    - I would like the control source to change based on the current quarter. The data in the textbox reflects an officer's comments which changes each quarter.
    - The comments are contained in the table: TBL_ActionPlan
    - The Field Name...
    See more | Go to post

    Leave a comment:


  • Merlene
    replied to Setting controlsource to Dlookup
    Hi Twinny,

    Yes, I've tried it directly in the control source to ensure that the function was otherwise working however, I wanted the control source to be dependent on the quarter. Here's my full code:

    Code:
    Private Sub Form_Load()
    
        If GetQuarter() = 4 Then
            Me.txtPreviousActionPlan1.ControlSource = _
                Nz(DLookup("Q3Milestone1", _
                           "TBL_ActionPlan",
    ...
    See more | Go to post
    Last edited by twinnyfo; Oct 29 '18, 10:39 AM. Reason: please use the [CODE/] button when posting code.

    Leave a comment:


  • Merlene
    started a topic Setting controlsource to Dlookup

    Setting controlsource to Dlookup

    Good Day,

    I am attempting to set the controlsource of a textbox on a form to a dlookup function but it isn't working. The field just appears blank. When I check the code in the immediate window I get compile error: variable not yet created in this context.

    I am relatively new to Access but I've been trying to figure this out on my own with no luck so far.

    Code:
    Me.txtPreviousActionPlan1.ControlSource = _
    ...
    See more | Go to post
    Last edited by twinnyfo; Oct 29 '18, 10:41 AM. Reason: added mandatory code tags

  • Thanks Twinny, yes I realized the closing parentheses was missing, I only tested for today's date so didn't pick up on the rest. Thanks again for the correction.
    See more | Go to post

    Leave a comment:


  • Thanks Twinny & Neo. I will set the quarters first and proceed from there. I will start a new post based on my progress after.
    See more | Go to post

    Leave a comment:


  • Thanks Twinnyfo, I admit that I should have assigned a better name, I am just starting off with Access and I would learn these lessons the hard way if they aren't pointed out. So I will definitely be more mindful going forward.

    I put the "Test" in there only in an effort to see if what I was attempting was working. I actually want the form to pull from a different field based on the quarter that we are in. As each quarter's...
    See more | Go to post

    Leave a comment:


  • Dynamically changing the control source of a textbox

    Good Day,

    I am attempting to change the control source of a textbox (Ms Access 2013) based on the quarter; however; the quarters I am using are not standard quarters. I've tried several options but nothing has worked so far. My quarters are:
    November - January
    February - April
    May - July
    August - October
    The following is the last thing I've attempted (there were several previous unsuccessful attempts):...
    See more | Go to post
    Last edited by twinnyfo; Oct 24 '18, 05:33 PM. Reason: added code tags and formatted for viewing.

  • Actually I see what you're saying. I tried your method and although longer, it works! Thanks.
    See more | Go to post

    Leave a comment:


  • Thanks PhilOfWalton but I used the other suggestions as it was simpler to add the line of code.
    See more | Go to post

    Leave a comment:


  • Luk3r,

    Thanks! The syntax was just slightly different but it pointed me in the right direction. Here's what I used

    [Meeting_Notes.S elStart = Len(Meeting_Not es.Text) + 1]
    See more | Go to post

    Leave a comment:


  • Automatic Bullets for Textbox with Long Text Data Type

    I would firstly, like to add a bullet to a Form textbox as soon as the user begins typing and secondly, add a bullet to each new line. I have code that works fine when the datatype is short text but I am unable to get something that works for long text/ memo. I am using Ms Access 2013. This is what I use for the short text:

    [Private Sub Meeting_Notes_C hange()

    If Len(Trim(Meetin g_Notes.Text)) = 1 And _
    ...
    See more | Go to post
No activity results to display
Show More
Working...