Results 1 to 8 of 8
  1. #1
    Star Lounger
    Join Date
    Aug 2002
    Location
    Des Moines, Iowa, USA
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using data grids (XP)

    I have an Access program for Account Maintenance that a user can put in an account number and do either Add, Change, or Inquire. I have it working, but one feature seems kinda hokey to me.

    If a user cannot remember an account number, there are two buttons the user can click to do an account search. One runs a query asking to supply a city name, and the other prompts to supply a company name. The results of this query populates a recordset that feeds a second form showing only one record of data at a time. The navigation bar is used to page through the results. Once the account is found, the user clicks on a radio button which will then load the account number from the second form onto the first form. I told you it was hokey!

    Is there a way to display all records returned from the query at one time to a form and allow the user to select one of the rows to return to the original form? I've looked into subforms a little, I don't know if I'll be able to create an array of radio buttons on a subform though. This isn't a real unique request, my Access programming skills are still in its infancy so the problem lies between planning what I want vs. coding the plan. Any help is appreciated.

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Using data grids (XP)

    You could use a ComboBox on your 1 form to select the record you want then populate that 1 form with the record selected.
    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  3. #3
    Star Lounger
    Join Date
    Aug 2002
    Location
    Des Moines, Iowa, USA
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using data grids (XP)

    I'm not sure if you mean that a combo box be used for the city and company name in the initial form, or a combo box be used to display the accounts the query generates.

    A combo box on the initial form for city or company name will keep the user from typing in the criteria, but can still generate more than one record from the query. This still gives me the same hokey second screen showing one record at a time instead of all matches displaying on the form.

    A combo box for the account would work great if was the only field displayed on the second query results screen, but it is not. I don't think I explained that detail very well (if at all), and I apologize for the omittance. On the second form that displays the query results of the city or company name, other fields are also displayed to help identify the accounts that fit the criteria such as city (if searching by company name), or company name (if searching by city), and address.

    I was hoping to find a more visually pleasing technique to displaying the information than my one record per screen, scrolling through via the navigation bar. I know in .NET there is a data grid object that displays information well (though I've never worked with it), and didn't know if an animal such as this existed in Access where all records from a query can be dumped into a tabular format (like a spreadsheet), where the user can select the appropriate record.

    Thank you for your response. If I have misunderstood your solution, let me know. Misreading stuff is one of my specialties!
    <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23>

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Using data grids (XP)

    There is a data grid control available in XP but the license comes with the developer's edition. Why not just use a continuous form, either a popup or a subform on your criteria form, and display the results of the query there?
    Charlotte

  5. #5
    Star Lounger
    Join Date
    Aug 2002
    Location
    Des Moines, Iowa, USA
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using data grids (XP)

    I started to toy with the idea of a subform, but I didn't know if I had the ability to insert a column at the beginning of each row to allow the user to select the account he/she wants to use. I also need to do some homework on how to populate it. Being a newbie, each project brings about new concepts to learn. This one looks to be subforms. Thank you for your input!!! <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Using data grids (XP)

    Well, ordinarily I would say that subforms were much easier than the data grid, especially if you don't have much experience working with activex controls. However, your remark about adding a column has me baffled. If your user is going to select a single account to use, you don't need an additional column. If they click on a record, that becomes the current record in the subform and all you have to do is refer to the values for the in that subform in order to get information about the record they picked. Perhaps you should explain a bit more about what you're trying to do before we send you down the wrong road.
    Charlotte

  7. #7
    Star Lounger
    Join Date
    Aug 2002
    Location
    Des Moines, Iowa, USA
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using data grids (XP)

    My expertise on subform in Access is nil. When programming a technique in a language you are not very familiar in, you revert to practices used in prior languages. In my instance the language is RPG and the technique is called a subfile. Here, you when a list was created and one needed selected, a field needed to be added so the user could select the appropriate item. My assumption was that the Access subform would work in a similar fashion, but your last message is telling me that is not the case.

    Another problem I am facing is determining how to create the subform because a common field is needed between the main form and the subform. City and Company Name are fields only found in the Address file, so I'm not sure how to link the forms together. I wonder if a second unrelated form is the way to go, just create it in a spreadsheet format. If this is the way to go, I have some questions concerning it (which I will also check into). My main resources are Que Using Access 2000 and Access 2000 Developer's Handbook by Getz, Litwin, and Gilbert. If you have other preferences, let me know.

  8. #8
    Star Lounger
    Join Date
    Aug 2002
    Location
    Des Moines, Iowa, USA
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using data grids (XP)

    I played around with using a second form put in a datasheet format, and I got everything to work!!! By placing code behind the Account Number Click event, I was able to extract the account number and place it in the account number field of the initial form. Thank you for all your help!!! Steering me towards using the datasheet was the ticket!! <img src=/S/bananas.gif border=0 alt=bananas width=33 height=35>

Posting Permissions

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