Results 1 to 11 of 11
  1. #1
    hcuk is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    22

    Creating a form that resembles a excel worksheet. Pictures included.

    Hello fellow Access users,



    I am trying to "Convert" the excel worksheet to a form in Microsoft Access. I'm not quite sure what the best approach is. I've included the screenshot of the excel and a screenshot of the Form that i've created. The form looks good, but the way it works is not what I am going for, it's not inserting into the table correctly. Please Advise and Thanks in advance,
    Click image for larger version. 

Name:	Excel.png 
Views:	11 
Size:	22.7 KB 
ID:	18696

    Click image for larger version. 

Name:	Access Form.png 
Views:	11 
Size:	23.6 KB 
ID:	18697

    Click image for larger version. 

Name:	2014-11-12 12_10_39-Access - Legacy Project Tracker - V 3.1 _ Database- C__Users_RQuach_Desktop_.png 
Views:	11 
Size:	13.3 KB 
ID:	18698

    Richard

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    I think you may want a form/subform.
    The master form has the date? (or whatever is the master id)
    and the sub-form has all related records below.

  3. #3
    hcuk is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    22
    Quote Originally Posted by ranman256 View Post
    I think you may want a form/subform.
    The master form has the date? (or whatever is the master id)
    and the sub-form has all related records below.
    Thanks for the reply,

    I've tried it with a sub form but when I finish entering everything at the top section, and tab to the sub form, everything in the top section is cleared. I want the top section to remain there when I enter data into the sub form.

    It also isn't inserting into the table correctly, I've included a screen shot of what it's supposed to look like.

    Click image for larger version. 

Name:	Excel.png 
Views:	9 
Size:	14.7 KB 
ID:	18703

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    The form /subform WILL enter it correctly, so I dont think you have that goin on.
    You may have a split form.
    Use the wizard to build a master/child sub form, and make sure you tell it the KEY values.

  5. #5
    hcuk is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    22
    Quote Originally Posted by ranman256 View Post
    The form /subform WILL enter it correctly, so I dont think you have that goin on.
    You may have a split form.
    Use the wizard to build a master/child sub form, and make sure you tell it the KEY values.
    Would I need to create a new table that contains only columns from the bottom section, and remove those columns from the master table.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Probably Yes.

    Sounds like you need a better understanding of relational database concepts. Maybe this will help http://www.rogersaccesslibrary.com/
    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.

  7. #7
    hcuk is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    22
    Quote Originally Posted by June7 View Post
    Probably Yes.

    Sounds like you need a better understanding of relational database concepts. Maybe this will help http://www.rogersaccesslibrary.com/

    Thanks. I've figured it out. created a table and created a relationship between two columns.

    But i have another question. I'm trying to create a clear button, to clear the master form and the sub form.
    Currently this is my code that will clear the fields in the master form, would it be possible to add more code to clear the sub form as well?

    Code:
    Private Sub Clear_Button_Click()    Dim ctl As Control
        For Each ctl In Me.Controls
        If ctl.ControlType = acTextBox Then
        ctl.Value = Null
        End If
        Next ctl
    End Sub
    Please let me know if need to create a new thread for this.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Are these bound forms and bound controls? Don't want to 'clear' bound controls - that would delete data.

    Maybe you want to move to new record row?
    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.

  9. #9
    hcuk is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    22
    Quote Originally Posted by June7 View Post
    Are these bound forms and bound controls? Don't want to 'clear' bound controls - that would delete data.

    Maybe you want to move to new record row?
    They are bound controls. If I went the new record route, I'm not sure how to code it so that it moves to a new record for both the subform and master form.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Moving to new record on main form is easy.

    DoCmd.GoToRecord , , acNewRec

    Subform should not be a concern because there won't be any records since the main form is a new record, assuming the forms are properly linked.
    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.

  11. #11
    hcuk is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    22
    Quote Originally Posted by June7 View Post
    Moving to new record on main form is easy.

    DoCmd.GoToRecord , , acNewRec

    Subform should not be a concern because there won't be any records since the main form is a new record, assuming the forms are properly linked.
    That worked perfectly. Thanks June7! You've been a great help!

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

Similar Threads

  1. Replies: 12
    Last Post: 02-07-2014, 04:54 PM
  2. Export Form And Subform Data To Excel Form Same Worksheet
    By tomtheappraiser in forum Import/Export Data
    Replies: 6
    Last Post: 08-12-2013, 10:39 AM
  3. Replies: 1
    Last Post: 08-09-2012, 12:06 PM
  4. VBA to Import Excel Worksheet
    By bdaniel in forum Programming
    Replies: 2
    Last Post: 11-23-2010, 10:53 AM
  5. Importing the second excel worksheet
    By geoffwbailey in forum Programming
    Replies: 1
    Last Post: 06-25-2010, 12:16 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