Consulting

Results 1 to 11 of 11

Thread: Database Userform VBA Code Help Please

  1. #1
    VBAX Regular
    Joined
    Nov 2008
    Posts
    14
    Location

    Smile Database Userform VBA Code Help Please

    Q1. How would i go about setting up a new userform to view the records, say with 12 textboxes (named after columns A-L) with 3 cmdButtons - one button for "Next Record", one for "Previous Record" and one for "Close" (to close form). The Next and Previous buttons would be used for navigating next and previous records in supplier database.

    Q2. I also need to set up a separate userform to be able to Amend and Delete existing data in the database. I already have a userform setup for Adding new data.

    Any help, suggestions, and hopefully solutions will be much appreciated.

    Regards,

    Matt
    Last edited by matty25; 11-03-2008 at 12:28 PM.

  2. #2
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Greetings matty25,

    Well welcome! I just joined VBAX recently myself, though I had been visiting the forum for a couple of years. You will find that there are some mighty nice folks here, and even when I was just "watching" and learning as a guest, I would see that folks would make every efforts to come up with a solution to all sorts of problems. Anyways, I'm sure you'll like it here, and wanted to be the first to say "Howdy".

    As to your current project:

    As you are trying to populate the list box with only the results of a search, I can see why RowSource wouldn't work right off. That said, there is a 10 column limit on an unbound listbox.


    ...Deleted...

    Cross posted at: http://www.ozgrid.com/forum/showthread.php?t=117308

    Matty or Matt:

    You cross posted your very first thread! Please do not waste the time of those trying to help you by having them repeating what someone else has already said, or duplicating efforts.

    Mark
    Last edited by GTO; 11-03-2008 at 12:21 AM.

  3. #3
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location

  4. #4
    VBAX Regular
    Joined
    Nov 2008
    Posts
    14
    Location
    I'm sorry if this has offended anyone in any way..

    Regards, Matt
    Last edited by matty25; 11-03-2008 at 12:27 PM.

  5. #5
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Matt, It is a matter of courtesy. If you post in several locations and someone has already provided a solution then it would be nice to know before investing any time in helping you find a solution....

    Click here for a detailed explaination. Just provide the links and all will be well although some folks will still overlook your thread if they know you are posting in multiple forums instead of trying one forum until you no longer are getting the help you need.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  6. #6
    VBAX Regular
    Joined
    Nov 2008
    Posts
    14
    Location
    Okay Lucas, point taken.

    I will agree to post in this forum alone unless i cant get the answer/help i need.

    Regards, Matt

  7. #7
    VBAX Master CreganTur's Avatar
    Joined
    Jan 2008
    Location
    Greensboro, NC
    Posts
    1,676
    Location
    Quote Originally Posted by matty25
    Okay Lucas, point taken.

    I will agree to post in this forum alone unless i cant get the answer/help i need.

    Regards, Matt
    Be sure to read the article that lucas put in his post. It's not a sin to cross-post, but if you do cross-post over multiple forums then you need to include a link to your cross-post for courtesy's sake.

    BTW, welcome to the forum- it's always good to have new members! I hope this first experience doesn't color your view of VBAX too much; you'll find this to be a very friendly and informative environment filled with a lot of knowledgable people.
    -Randy Shea
    I'm a programmer, but I'm also pro-grammar!
    If your issue is resolved, please use Thread Tools to mark your thread as Solved!

    PODA (Professional Office Developers Association) | Certifiable | MOS: Access 2003


  8. #8
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Hi Matt,

    Hopefully my response was not overly blunt, but maybe I could have worded it more graciously.

    Welcome. Did you ever get a satisfactory 12 column listbox accomplished?

    Mark

  9. #9
    VBAX Regular
    Joined
    Nov 2008
    Posts
    14
    Location
    Quote Originally Posted by GTO
    Hi Matt,

    Hopefully my response was not overly blunt, but maybe I could have worded it more graciously.

    Welcome. Did you ever get a satisfactory 12 column listbox accomplished?

    Mark
    Thanks GTO, yeah i managed to get it to work in the end.

  10. #10
    VBAX Tutor phendrena's Avatar
    Joined
    Oct 2008
    Location
    Huddersfield, UK
    Posts
    285
    Location
    Hi,

    I was wondering if you could post a copy of the workbook as i'm looking to do something similar and would like to view a working example.

    I have also posted in your thread on MrExcel : http://www.mrexcel.com/forum/showpos...47&postcount=3
    In that thread i have asked mikerickson who helped with your query if he could help me expand a little on what you have done :
    Hi,

    I'm also interested in the above and have setup a really quick worksheet (sheet1) and created a basic userform with :

    Textbox1
    Listbox1
    CommandButton1

    When i click the command button assigned to butFindAll i get the following error :

    Runtime error '13'
    type mismatch

    the debugged then highlights : ArrayOfMatchingRows = Application.Transpose(DataArray)

    In column A i have my Dates, displayed as dd/mm/yyyy (UK format).

    Now, if i change the range that the code looks through to D which contains a Dealer Code rather than a date then the listbox is then populated but with the data from column D onwards.

    So...

    1) Why is the date causing a problem?

    2) How can I still use column D (or others) as my search criteria and still have all the data in the listbox?

    3) How can i restrict what data it shows in the listbox, for example perhaps just columns A, D, F & H?

    -----------------

    You also mentioned that it would be possible to create on this userform a way to edit the data and have it update what has already been entered.
    Would you be able to advise how this can be done?
    I weould prefer to use one userform that has the search and editing functions in one rather than two forms or forms with multiple pages if at all possible.

    Many Thanks,

    Thanks,
    Last edited by phendrena; 11-05-2008 at 06:32 AM.
    Somewhere in the dark and nasty regions where nobody goes, stands an ancient castle.
    Deep within this dank and uninviting place lives Berk, overworked servant of The Thing Upstairs.
    But thats nothing compared to the horrors that lurk beneath The Trap Door.

  11. #11
    VBAX Regular
    Joined
    Nov 2008
    Posts
    14
    Location
    Hi, i posted my workbook in this post, feel free to download:

    http://vbaexpress.com/forum/showthread.php?t=23290

    Regards, Matt

Posting Permissions

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