Results 1 to 6 of 6
  1. #1
    funkygoorilla is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    93

    Open form from parameters

    Hi,
    I created a form that takes query parameters for ease of use. It has three parameters that are linked to a query, but when run, the intended form opens, but none of the query results show up. I have gotten this to successfully work with a report, but something is missing and I cant figure out what. Anyone have any ideas?
    Thanks, FunkyG

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Not enough info. Would need to examine the project.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    funkygoorilla is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    93
    Hi, I have attached a zip that includes the front end and back end of my project. What I am looking to do , is get a form that uses unbound fields for query parameters, to put query information into a form that a user then completes. The only problem is that the query info wont come over to the form, it just shows up blank. Its the form called frmEndShiftInfo. I want a it to work similar to the form call frmPrintDFAR. Think you wouldnt mind taking a look?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    First of all, using query input parameter prompts, especially multiple inputs, is bad idea. It is impossible to validate the user input and user will invariably type invalid data. The query will continue to run in spite of the bad input, form will open without expected results and user is left confused and frustrated. I never do this. I build forms for user input and have the query refer to the form controls as inputs. Nothing happens until user entries are confirmed valid.

    Otherwise, I see nothing wrong with the parameters, providing each is responded to with a valid input.

    You did not include data in the ShiftInfo table for testing. I added a single record and form pulls up that record.

    However, for some reason the DLookup for the names did not work. Instead of DLookup for names, join the Deputies table to the ShiftInfo table in the form's RecordSource (jointype - 'Show all records from ShiftInfo...). This will make related name info available for display on form. This is basic functionality of relational database. Also, domain aggregate functions can slow performance of forms and reports. Display the names by binding textboxes to the fields. Set the boxes as Locked Yes and TabStop No so that users cannot modify on this form.

    I ran Compact&Repair on the project and the size reduced from 12.8mb to 1.2mb. Should do this periodically and certainly before upload.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    funkygoorilla is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    93
    Hi, thanks for checking it out for me. I do agree with you on the parameters for queries. That is why I am switching from prompts to forms. It was not completed in the version I sent you, but the user will pick one value from a combo boxt, and the only other value that they would have to put in, would be a single digit. The other prompts are going to be date fields with date pickers, and it will default to the current date. I did manage to figure out my issue, but one thing you may be able to help me out with is the value chosen from the combo box. I have three fields for this query to work. One is pre-populated, one is a combo, and one is a date. When I pick the desired value from the combo box, the query wont run. But when I remove the combo box, and use a text box, the query does run. Is there a trick to using combo box selections in queries?
    THanks again.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Comboboxes (and listboxes) can be multi-column. Have to be sure getting the correct value into the criteria. All depends on which column is designated in the BoundColumn property. Value is default property of data controls and in a combobox this will be determined by the BoundColumn property. If you don't want the BoundColumn value, refer to appropriate column with Column Index. Index begins with 0 so column 2 would be Index 1.

    = Me.combobox.Column(1)

    I normally make the ID field the first field of a combobox RowSource query. Then I set column 1 as the BoundColumn. Can set width of that column to 0 and users won't see it, they will see the next field of the SQL in the combobox, probably a name value which has more meaning to users and they make their selection by the name. The BoundColumn needs to be set to the column with value that must be saved.

    How is your combobox set up?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Search form with Two parameters
    By karanvemuri in forum Forms
    Replies: 11
    Last Post: 10-03-2011, 06:26 PM
  2. Form to supply parameters to a report
    By Ray67 in forum Reports
    Replies: 11
    Last Post: 07-22-2011, 02:06 PM
  3. Passing parameters from a form
    By rfs in forum Forms
    Replies: 1
    Last Post: 03-15-2011, 12:25 AM
  4. Replies: 2
    Last Post: 02-26-2010, 08:14 AM
  5. Form to enter all parameters in a macro
    By jackthedog in forum Access
    Replies: 0
    Last Post: 05-05-2009, 04:47 PM

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