Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jul 2005
    Location
    North Carolina, USA
    Posts
    195
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Refreshing list box in a subform (2003)

    Hi, I am exhausted trying to make this thing to work. I have three tabs in my frmPersonnel with two subform. I want to be able to refresh information in the emergency contact TAB like the field lstSpouseFirstName and other fields in the Emergency TAB when the qryEmergencySpouse updates its information in accordance with the dependent TAB. Right now the information will refresh if i put a refresh button command or IF I close the form and reopen it. I want that event to happen automatically. Finally, I am trying to make the information showing in the lstSpouseFirstName (Emergency TAB) be save in the control source SpouseFirstName from the tblDataEmergency. Any help is appreciated.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Refreshing list box in a subform (2003)

    Why are lstSpouseFirstName etc. list boxes? You can see only one item in them, and anyway a person can have only one first name. So I think they should be text boxes instead of list boxes.

  3. #3
    2 Star Lounger
    Join Date
    Jul 2005
    Location
    North Carolina, USA
    Posts
    195
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Refreshing list box in a subform (2003)

    I just dont want to retype the info again. The information is displaying in the list box but it is not been save in the table tblDataEmergency. If you change the relationship from wife or husband to another type and you refresh the Emergency TAB it will not show the info in the list box because the SQL statement only will display an spouse. I will like to be able to update that info automatic without inserting a refresh button. and be able to same the display info into the tblDataEmergency. I know it looks crazy but any sujections is good

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Refreshing list box in a subform (2003)

    The SpouseFirstName etc. controls are locked, so you can't enter anything in them.

    I think you should reconsider your setup. Instead of having one record in tblDataEmergency with fields for Spouse, Other, NOK1 and NOK2, you should have a separate record for each role, with a field specifying the role. In fact, I think you could merge tblDataDependents and tblDataEmergency. You can then create a query to select (for example) someone's spouse.

  5. #5
    2 Star Lounger
    Join Date
    Jul 2005
    Location
    North Carolina, USA
    Posts
    195
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Refreshing list box in a subform (2003)

    Thank you Hans, I combine the two tables and create queries, it works better. I was putting to much thoughts into it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •