Page 1 of 4 1234 LastLast
Results 1 to 15 of 54
  1. #1
    Ramsi2001 is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    28

    Smile Tabular Data Design

    Hi,


    I am thinking of a design of the forms in a following way:


    I have a search criteria. Based on the search results, i want to populate the data in a tabular form on the same page below:

    And when the user selects a record in the results pane, he should get redirected to a modify page wherein he can edit the record he selected.


    Can any one suggest me the best way to design this?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If you have a variety of optional search criteria, the sample db in this FAQ demonstrates one way of doing the search form:

    http://www.baldyweb.com/BuildSQL.htm

    Once you have the resulting records, this technique can be used to open the second form:

    BaldyWeb wherecondition
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Ramsi2001 is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    28

    Tabular Data Design

    Hi There,
    Thanks a lot for the reply!!!

    I went thru the links and they solve my problem mostly.

    The only question i have is:

    Where i should write the code of OpenSecond form?

    How will the system know which record i have selected? Do i need to use any command button for this purpose?

    I am a bit new to access and hence the questions? Sorry to bother you...

    Thanks,
    Ram

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Don't be sorry about asking questions. This wouldn't be much of a forum without questions!

    Two common places for the code to open the second form would be a button located in the detail section of the form or the double click event of a textbox in the detail section (ie, double click on a person's name to edit their details). In either case, "Me.ControlName" would refer to the record being clicked on.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Ramsi2001 is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    28
    Thanks a lot Paul!!!

    I think it will work for me.


    Thanks,
    Ram

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help Ram. Post back if you get stuck. Welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Ramsi2001 is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    28

    Stuck with a issue

    Hi Paul,
    I am here after a long time.

    As we discussed, I could able to open the new record in a modify screen.

    But the problem is with the record navigation and record selectors.

    The record no. is always shown as 1 even if i select any other record. This was when i try to navigate to other records, it is giving me duplicate index error.

    For example, if i select third record, it's showing as 1 always.

    How can i show exact record no in the record navigator?

    PLease help.

    Thanks,
    Ram

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I confused as to what the problem is. Can you post a sample db, or at least a picture?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    Ramsi2001 is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    28

    Details about the issue

    Hi Paul,


    I have attached the screenshots in the doc file.

    In the first screenshot, i am displaying the search results. When the user double clicks a record, i am opening the modify page.

    Here is the code i am using to open the modify page.

    reccount = Me.CurrentRecord
    'MsgBox (reccount)

    varargs = Project_ID.Value & ";" & reccount
    DoCmd.OpenForm "frmProj_Modify", , , , , acDialog, varargs

    Now, in the modify page, i am writing this code to retrieve the record details.

    If Not IsNull(Me.OpenArgs) Then
    args = Split(Me.OpenArgs, ";")
    strProjectId = args(0)
    reccount = CInt(args(1))
    End If

    DoCmd.GoToRecord , , acGoTo, reccount

    Now, when i open it, it's opening fine. But when i try to save it, i am getting the error as you can see the second screenshot.

    The command i am using is Runcommand acCmdSaveRecord.

    What should i do? PLease help

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Maybe it's just a matter of how the screen shots were taken, but on the first one record 1756 has focus, but record 1802 was brought up on the second form. Personally I wouldn't use CurrentRecord like that. It would require the 2 forms to have identical sources, and I'm not sure how reliable it is to do what you're trying to do. I'd use the technique in the second link I posted in post 2. That technique uses the explicit key field value rather than the record number returned by CurrentRecord. I think there's less chance for error or confusion.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    Ramsi2001 is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    28
    Hi Paul,
    I understand what you are saying.

    If i use the where condition in the first form, do i need to write any extra code in teh seocnd form.

    Please let me know... And also i try to use the where condition. I am getting error as:

    OpenForm action is cancelled

    The code i wrote was:
    DoCmd.OpenForm "frmProj_Modify", , , "Project_id=" & Me.Project_ID


    Thanks,
    Ram

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Using either of the methods on my link, there is no code necessary in the second form. Are you getting that error after taking the code out of the second form? What is the data type of Project_id?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #13
    Ramsi2001 is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    28
    I think that's the probelm.

    The field is of type Text. So i changed to string type and i got it correctly.

    The only thing is in the second form, i am unable to navigate to other records.

    But still thanks a lot!!!

  14. #14
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If you look at the bottom of that page, I have another page that demonstrates a method to open a form to a specific record while still having others available.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  15. #15
    Ramsi2001 is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    28
    Hi Paul,
    I am really sorry that i overlooked this one.

    But you are really the MVP

    Thanks,
    Ram

Page 1 of 4 1234 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Tabular Form
    By Evgeny in forum Forms
    Replies: 0
    Last Post: 04-26-2010, 08:39 PM
  2. Remove items from Tabular Form
    By JoshS in forum Forms
    Replies: 3
    Last Post: 04-26-2010, 02:18 PM
  3. Positioning Tabular Labels
    By rod147 in forum Forms
    Replies: 6
    Last Post: 07-06-2009, 11:02 AM
  4. tabular forms - setting values per each record
    By Daytona675 in forum Forms
    Replies: 0
    Last Post: 11-25-2008, 09:43 AM
  5. Design help
    By marix in forum Database Design
    Replies: 1
    Last Post: 04-18-2007, 07:54 AM

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