Results 1 to 6 of 6
  1. #1
    Ayiramala is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74

    Cannot do data entry

    Hi,



    I have been trying to create a db for the schools in our district, with moderate success. Everything is setup, but the problem is, when I try to enter data, the records do not update. When I try to add a new school in tblSchools it is not added. The DistrictID is not addedin the table tblSchools. Similarely SchoolID is missing in tblStaff.

    Could you please take a look at the sample attached?

    Many thanks for all your help.
    Attached Files Attached Files

  2. #2
    Ayiramala is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74
    If I use a form - subform setup instead of opening the forms separately(in a new window), data can be entered without a problem. So that may be the problem? If that is the case, is there a way to keep the existing design? How do we connect the two forms?

    Edit: So it is like how to make a continuous form the subform of another continuous form, right?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    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.

  4. #4
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I can not tell where you are headed with this db. It doesn't look like you have drawn out a plan on paper/whiteboard/etc before starting Access.

    Here is your relationship window
    Click image for larger version. 

Name:	tables1.png 
Views:	16 
Size:	59.1 KB 
ID:	36742



    So starting with the unbound form "frmSelectDistrict", you select a district, then click the select button.
    The code that is executed is
    Code:
    Private Sub Command4_Click()
        DoCmd.OpenForm "frmSchools", acNormal, , "DistrictID = " & Me.Combo2 & " "     '  (1)
        DoCmd.GoToRecord , , acNewRec      ' (2)
        DoCmd.Close acForm, "frmSelectDistrict"     ' (3)
    End Sub
    1) this line opens form "frmSchools" and filters the records to match the value of Me.Combo2
    2) this line goes to a new record
    3) then a form is closed.

    Nowhere has a value been added to any field for frmSchools.DistrictID. All that happens is the records that match the DistrictID are displayed.
    You need to have a combo box on the form "frmSchools" to select the DistrictID.


    For form "frmStaff", you need to add a combo box to select the "SchoolID".
    Also, the field "StaffName" should be split into two fields: StaffFName and StaffLName.


    -----------

    I was wondering,
    can a staff member work at more than one school at the same time?
    can a staff member teach more than one subject?
    If either is true/yes, you will need to change the structure - you will need to add a junction table (or 2).
    Attached Files Attached Files

  5. #5
    Ayiramala is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74
    Thanks for the detailed information. Much appreciated.

    I first set this up as a form - subform - sub-subform (to enter district, school and staff details). And it worked properly. But then I thought this continuous form may look better. I then changed it, and messed it up.

    Other than this, did you notice any errors in design? Please let me know.

    To answer your questions: no, a particular staff member works only in one school, and he teaches only one subject.

  6. #6
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Other than this, did you notice any errors in design?
    No errors jump out.....You don't have spaces in names, no reserved words, no look up fields (in tables)...
    I use a different naming scheme, but that is me.

    I would split the field "StaffName" into "StaffFirstName" (or "StaffFName") and "StaffLastname" (or ("StaffLName").
    Instead of "PhoneNo1" I would use "PhoneNum1"
    If "SchoolMailID" and "StaffMailID" are for E-Mail addresses, I would change the names to "School_eMail" and "Staff_eMail".



    Here is an example with form/sub form design
    Attached Files Attached Files

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

Similar Threads

  1. Replies: 8
    Last Post: 03-15-2018, 12:23 PM
  2. Replies: 4
    Last Post: 12-21-2015, 10:57 PM
  3. Replies: 7
    Last Post: 03-05-2015, 07:34 AM
  4. Replies: 5
    Last Post: 03-09-2014, 07:16 PM
  5. how to copy last entry data for new entry
    By alexandervj in forum Access
    Replies: 7
    Last Post: 11-13-2013, 02:57 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