Results 1 to 3 of 3
  1. #1
    Esmatullaharifi is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    40

    Question Problem with text box value in form

    I have two forms where in first form i have options for second form. In first form i have a text box and its value is copied to second form using this code
    Code:
    =Forms![FirstForm]![Counter]
    but when i open second form using button in first form the vba message that counter value is empty. I used vba if code in second form on counter


    Code:
    if counter.value = 1 then
    solo.visible = true
    end if
    Please Help Me.

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    What code are you using to open the second form?

    Is the Value for Counter, in the first form, being entered and then you're using a button to go to the secondary form? If so, you probably need to save the record in the first form before opening the second form. Either of these commands will do this:

    If Me.Dirty Then Me.Dirty = False

    or

    DoCmd.RunCommand acCmdSaveRecord

    Not sure what you mean by this:

    I used vba if code in second form on counter
    but that code would need to be in the Form_Load event of the second form...not in an event associated with the Counter Field.

    Linq ;0)>

  3. #3
    Esmatullaharifi is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    40
    counter is unbound and not connected to any table.
    I have conditions in first form and also in second form according to counter. the counter value may change time to time according to conditions and the second form also depending on this counter.
    This code was good but when i use it many times in many forms the error is displayed.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Problem with text box
    By beaurou in forum Modules
    Replies: 2
    Last Post: 09-17-2014, 12:12 PM
  2. Text Box Controls Problem
    By hwong in forum Forms
    Replies: 3
    Last Post: 08-12-2012, 09:04 PM
  3. Text field to Combo Box problem
    By petefc in forum Database Design
    Replies: 11
    Last Post: 01-26-2012, 11:19 AM
  4. formula in text box problem
    By kwooten in forum Reports
    Replies: 7
    Last Post: 09-12-2011, 08:19 AM
  5. Text/Number Relationship Problem
    By Luke in forum Access
    Replies: 4
    Last Post: 07-07-2011, 11:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums