Results 1 to 3 of 3
  1. #1
    Anne_VW is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    May 2019
    Location
    Belgium
    Posts
    1

    implicit allocation

    Hi,

    I have a form with several fields.
    The code behind these fields is exactly the same.
    example: see attachment



    I would like to write one sub and give the fieldnames as parameters to he sub
    see attachment
    Attached Files Attached Files

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Not on a computer right now but try

    Forms(strForm).Controls(strTextbox)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    Hi Ann!

    Give a try to the code below:
    Code:
    Private Sub cbxAfwerk3_Click()
       CheckOnOff  Me.Afwerk3,  Me.cbxAfwerk3
    End sub
     
    Sub CheckOnOff(ctrCheck As CheckBox, ctrImage As Image)
        If ctrCheck Then
            ctrImage.Picture = ""
            ctrCheck = False
        Else
            ctrImage.Picture =  strPath & "vink.jpg"
            ctrCheck = True
        End If
    End Sub
    Cheers,
    John

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

Similar Threads

  1. Replies: 1
    Last Post: 06-24-2016, 05:05 AM
  2. Oil well allocation
    By sean88 in forum Database Design
    Replies: 6
    Last Post: 03-02-2015, 11:08 AM
  3. Creating a Resource Allocation Table/Form
    By canderson in forum Access
    Replies: 7
    Last Post: 05-30-2014, 11:11 AM
  4. How to show monthly % allocation in database
    By Aneta in forum Database Design
    Replies: 11
    Last Post: 08-25-2011, 08:27 AM
  5. Implicit / explicit relationships in Access
    By starson79 in forum Access
    Replies: 4
    Last Post: 01-26-2011, 08:50 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