Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    mdavid is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2017
    Posts
    160
    Thanks Orange, I'll use this for the English Names.
    Another thing I'd appreciate help with is how to use the same above code for all the Common Name languages, just passing a parameter for each language (English, Hebrew, Arabic or Other) listbox query.

    Thanks for any help
    David

  2. #17
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I'm totally lost/confused now. I see many calculated controls (e.g. Species ID) and wonder why they just aren't bound.
    And many unbound controls that you want to copy data from, to the right side, which makes me wonder why the source controls are also unbound.
    And wonder why you'd bother to copy something to the right, only to want to delete it - unless you're thinking you can remove something from one column only, which can be done but is probably unnecessarily difficult given that there has to be a better way to achieve the desired outcome. In a multi column listbox or combo, Access divides the values amongst the columns. If you want to remove one item from one column, you have to end up with ;; between the last value from col 1 and the next value for col 1.

    Maybe post a copy of your db and we'll see if there are any other recommendations. But I fear that it will be all to confusing to decipher what is versus what should be going on. Alternatively, maybe you should just abandon this approach and try a main form with 3 subforms; top 2 for source data that can't be edited, bottom for editing, and load the bottom form with data from the other two via command buttons if you need to be selective. I still cannot see why listboxes are being used.

  3. #18
    mdavid is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2017
    Posts
    160
    Hi Micron, sorry i haven't succeeded in explaining the purpose of the form clearly. I have a good idea of what i want to do, I will show it to the user next week, and see if they're happy with this form.
    The next stage is to document all the medical complaints treated by these plants and I will consider using your suggestion of the 3 subforms there.
    Please could you explain or give me a link to an explanation of bound and unbound controls.
    Here is an example of the form in use:

    Click image for larger version. 

Name:	SpeciesFrm2.jpg 
Views:	11 
Size:	109.6 KB 
ID:	30790

  4. #19
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    A bound control is "linked" to a table or query field so that if the underlying data is altered the control can reflect the changes, or it can be used to modify the values in the field that it's bound to (assuming the record is updatable. An unbound control is not linked to any field. If it is used to add data to a table it must be done indirectly. Unbound controls are often used to display calculated or concatenated values amongst other uses.
    Last edited by Micron; 10-12-2017 at 06:07 PM. Reason: dang phone auto correct
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #20
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    David,

    Not sure of anything global re multi-languages. A lot probably depends on specifics of your application.


    An interesting, free video tutorial by DataPig re listboxes generally that may be of some value to you.
    It's not too long and well worth watching.

  6. #21
    mdavid is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2017
    Posts
    160
    Sorry not making myself clear again, I meant using the same vba code for several command buttons, just passing a parameter to the code to indicate which command button was pressed


    Thanks
    David

  7. #22
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Pass to what - the form opening? If so, you could pass whatever you like if you use the OpenArgs parameter of the DoCmd.OpenForm method. When the form not opens, you can check that parameter value, such as
    Code:
    Select Case Me.OpenArgs
      Case "apple"
        do apple stuff
      Case "orange"
        do orange stuff
     Case Else
        do default stuff
    End Select
    However, if you want to work with form values, use the load event to check the argument since form values aren't present until the Load event. Or based on the button clicked, you can make use of the form's filter property and apply a filter. Regardless, every button has to trigger the desired action by way of its Click event. Rather than repeat a bunch of similar code for each button click, you can first call a sub that accepts parameters, such as
    Code:
    Private Sub Command6_Click()
      MyCustomSub "orange"
    End Sub
    
    Sub MyCustomSub (msg As String)
    msgbox msg
    End Sub
    The red line is the only thing you'd need to have in every click event involved, as long as you alter the quoted value to suit each button. What you pass can be the button name or caption (if it has one) if that would be better (Me.Command6.Name or Me.Command6.Caption).
    Last edited by Micron; 10-13-2017 at 11:22 AM. Reason: code correction

  8. #23
    mdavid is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2017
    Posts
    160
    Hi Micron, Thanks for your clear explanation, I'll give it a try

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 16
    Last Post: 03-31-2020, 10:19 AM
  2. Replies: 4
    Last Post: 07-26-2016, 02:53 AM
  3. Replies: 7
    Last Post: 11-29-2015, 07:24 AM
  4. Show Checkbox when listbox item is selected
    By gammaman in forum Modules
    Replies: 5
    Last Post: 06-04-2015, 09:46 AM
  5. Replies: 7
    Last Post: 06-05-2012, 03:22 PM

Tags for this Thread

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