Results 1 to 14 of 14
  1. #1
    Twinnie is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    18

    Macros for a web database data entry form

    I am a newbie to Ms Access and I am sure this is a simple task for the professionals:

    I am currently designing a web database (using MicrosoftAccess 2010) that i wish to publish via Microsoft Sharepoint.
    There are 3 tables:
    Table1: Level_table


    Table2:UserDetails
    Table3:Submission

    The Table 1 and Table 2 are linked via the primary key of Level_table(Level_ID) which forms the foreign key on UserDetails table.

    The form called User_Input contains 2 textboxes (Firstname andSurname)-txtFirstname,txtSurname, and 5 combo boxes (Level, standard, bronze,silver, gold)-cboLevel,cboStd,cboBr,cboSil and cboGold.

    The table called UserDetails contain the following fields:User_ID-primarykey,Name, Designation,Level_Type,Level_ID-foreign key

    The table Level_table contains the following fields:Level_ID (primary key),Level_Type

    I have successfully populated the combo boxes with their respective selectionsbut I have been unable to populate the submission table with entries from theform using Macros.

    The User_Input form is expected to save its entries to the submission tablebased on the headings (similar to the controls on the form):
    ID (Autonumber),Firstname, Surname, Level, standard, bronze, silver, gold.

    I have successfully done this using VBA but VBA is not compatible with AccessServices for publishing to Sharepoint and hence the need to use Macros to get this to work.

    Thank you.


  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    The User_Input form is bound to Submission table?

    I don't understand the 5 comboboxes. What data is saved - Yes/No? Can a user have all five? If a user can be only one of the 5 then should be a single field and a single combobox bound to that field.

    The SetValue method is used in macros to programmatically save data to the form current record.
    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
    Twinnie is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    18
    Thanks a lot June 7,

    The User_Input form is bound to the Submission table via the property sheet function called RecordSource with the table stated there.

    The data in the 5 combo boxes are names of some staff and the different combo signifying Standard, Bronze, Silver and Gold are different award categories.

    The level combobox groups the names in the other comboboxes into levels based on the cboLevel selection (this is working well).

    The issue is that when i click the submit button on the form, the submission table is not populated with the entries from the form.

    Thank you.



    Quote Originally Posted by June7 View Post
    The User_Input form is bound to Submission table?

    I don't understand the 5 comboboxes. What data is saved - Yes/No? Can a user have all five? If a user can be only one of the 5 then should be a single field and a single combobox bound to that field.

    The SetValue method is used in macros to programmatically save data to the form current record.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    What is the RowSource of each combobox? Each of the five comboboxes are bound to field? Is this field a number type? Are you saving StaffID? Is StaffID a number value? Each of the 5 fields will always have a value for each record?
    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
    Twinnie is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    18
    Thank you June 7.

    Please find response below:

    cboLevel:SELECT Level_Table.Level_Type FROM Level_Table;
    cboStd:SELECT [UserDetails].[User_Name] FROM UserDetails WHERE ([UserDetails].[Level_Type]=[forms]![User_Input]![cboLevel]);
    cboBr:SELECT [UserDetails].[User_Name] FROM UserDetails WHERE ([UserDetails].[Level_Type]=[forms]![User_Input]![cboLevel]);
    cboSil:SELECT [UserDetails].[User_Name] FROM UserDetails WHERE ([UserDetails].[Level_Type]=[forms]![User_Input]![cboLevel]);
    cboGold:SELECT [UserDetails].[User_Name] FROM UserDetails WHERE ([UserDetails].[Level_Type]=[forms]![User_Input]![cboLevel]);




    Quote Originally Posted by June7 View Post
    What is the RowSource of each combobox? Each of the five comboboxes are bound to field? Is this field a number type? Are you saving StaffID? Is StaffID a number value? Each of the 5 fields will always have a value for each record?

  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,770
    So you want to save user name not a user ID? This is a text value and fields are text type?

    I don't know much about web database and SharePoint but in regular db I would not reference the subform in the RowSource.

    SELECT User_Name FROM UserDetails WHERE Level_Type=[cboLevel];
    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
    Twinnie is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    18
    the combo boxes are working well. the only challenge I have currently is how to populate my table 'submission' with the form inputs.

  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,770
    Are the comboboxes bound to the fields? What is their ControlSource property? Bound controls should automatically save value to record.
    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
    Twinnie is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    18
    Thanks so much June7.

    After I updated the ControlSource property, it worked.

    There is yet another problem: All submissions from the form only submits to the first row of the Submission table.

    Hence, the subsequent submissions keep replacing the previous submissions on the same first row.



    Quote Originally Posted by June7 View Post
    Are the comboboxes bound to the fields? What is their ControlSource property? Bound controls should automatically save value to record.

  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,770
    Must move to new record row for entering a new record.
    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
    Twinnie is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    18
    Hello June7,

    I presume I am asking very simple questions, kindly bear with me please.

    The problem I have is that each time i fill the form and click the submit button, the first row of the table "Submission" is filled with the entries; entries do not go into the next vacant row i.e it replaces the first row with new entries.

    Is there a macro I need to enable (on the Submission table or User_Input form )to ensure that entries are saved on the next available row on the Submission table.

    Thanks for the assistance.




    Quote Originally Posted by June7 View Post
    Must move to new record row for entering a new record.

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    On the form, first move to new record row then enter data. This should result in a new record in the table.

    Can set the form to open only to new record row by setting the DataEntry property to Yes. Then existing records will not be available for viewing or editing.

    Record entry/edit is committed to table when move to another record or close form or run code.
    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.

  13. #13
    Twinnie is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    18
    Thanks a lot June7.

    In this context, you are a life saver.

    I am grateful.

    Please how do I communicate that this has been solved?

    Thank you.


    Quote Originally Posted by June7 View Post
    On the form, first move to new record row then enter data. This should result in a new record in the table.

    Can set the form to open only to new record row by setting the DataEntry property to Yes. Then existing records will not be available for viewing or editing.

    Record entry/edit is committed to table when move to another record or close form or run code.

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Thread Tools dropdown above first post.
    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. Replies: 5
    Last Post: 03-09-2014, 07:16 PM
  2. Database design: data entry
    By Amen in forum Access
    Replies: 7
    Last Post: 09-30-2013, 03:03 PM
  3. Replies: 1
    Last Post: 12-06-2012, 06:11 PM
  4. Help with database design Many-to-Many and data entry
    By fftempest in forum Database Design
    Replies: 2
    Last Post: 03-19-2011, 08:44 AM
  5. Database Design / Data Entry
    By benjammin' in forum Access
    Replies: 1
    Last Post: 12-30-2010, 09:35 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