Page 3 of 6 FirstFirst 123456 LastLast
Results 31 to 45 of 87
  1. #31
    stmoong is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Sep 2011
    Location
    Singapore
    Posts
    108
    Quote Originally Posted by JFo View Post
    DoCmd.SetWarnings False" and "DoCmd.SetWarnings True"

    Get rid of them.

    Thanks, noted just picked this up in my travels
    It's better to execute your query as such, and use the On Error to catch and handle any error you might encounter.

    Dim strSQL As String
    Dim curDb As DAO.Database
    Set curDb = CurrentDB
    .....


    curDb.execute strSQL, dbFailOnError
    Last edited by stmoong; 09-30-2011 at 12:04 AM. Reason: Amended "currentdb.execute" to "curDb.execute"

  2. #32
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Quote Originally Posted by JFo View Post
    DoCmd.SetWarnings False" and "DoCmd.SetWarnings True"

    Get rid of them.

    Thanks, noted just picked this up in my travels
    The reason is that if your Code fails your warnings stay at False.

    Good that you are getting rid of these.

  3. #33
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Quote Originally Posted by stmoong View Post
    It's better to execute your query as such, and use the On Error to catch and handle any error you might encounter.

    Dim strSQL As String
    Dim curDb As DAO.Database
    Set curDb = CurrentDB
    .....
    currentdb.execute strSQL, dbFailOnError
    This is a much better approach.

    Thanks Stan and please continue to help with this thread if you can.

  4. #34
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Every answer can be and is a unique comment

    If ths is the case then why would you want to default to the previous answer.

    _____________________________________________

    If you want to Default to the previous answer then you will need to use DLookUP. Search this out and see if you can understand it.
    Last edited by Rainlover; 09-30-2011 at 05:59 AM.

  5. #35
    JFo is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    393
    Every answer can be and is a unique comment

    If ths is the case then whay would you want to default to the previous answer.


    Valid point however the first time anything is expected then it will be unique, however on a follow up inspection the default must be set as many things will remain the same for the specific piece of equipment and it will also serve as a reminder about what things should of changed as well

    It is for quickening the data entry process

  6. #36
    JFo is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    393
    DoCmd.SetWarnings False" and "DoCmd.SetWarnings True"

    These have now been removed, I will not use them again

  7. #37
    JFo is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    393
    Attachment 4656

    Hi Rain and whomever else may read this I think I have come quite a way, however I am retiring for the night as I have been at it all day and my head hurts

    I have attached the latest copy of my db for you to have a look at and there is still many things that need to be done. One major part I have been running around in circles with is trying to enter the IDs for the questions and answers in the results table as per frmEquipPressureVessel. I can enter the values into questions table (will be good later) and can enter EquipInspectID however can't work out how I can extract each ChecklistID and ChecklistAnswerID in my for loop. Any help with this code would be great.

    Additionally I had a problem inserting into my junction table for equipment and inspection from frmEquipment, it works at the moment however only if I delete the relationships between Equipment, Inspection and the junction table

    I know this is wrong but it is only way I could get it to work

    Thanks for everything and to any 1 else that may be able to help

  8. #38
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Try this. It is old but should help.

  9. #39
    JFo is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    393
    Ok getting much closer now, however still stuck in same parts. I read your tutorial and from that I take it that it is better to have a sub form for a many to many relationship. I have been trying all morning to create this sub form if only for equipmentID to keep the autonumber working, however no matter what code I use it cannot find the subform

    if I use something like
    [frmEquipment]![frmEquipmentSub].Form.[txtEquipment]
    or the usual
    Forms!frmEquipmentSub.txtEquipment

    This part I assumed would be easy as the bit I really have no idea about is the code to add each checklistID and ChecklistAnswerID to the results table. 1 step at a time

    Here is latest version however it keeps giving me more and more errors every time I convert it to 2003, Thanks

    Attachment 4668

  10. #40
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    There is an Icon in your MENU TOOLBOX that allows you to attach a Sub Form using a wizard.

    What is the name of the Form and SubForm you are trying to work on?

  11. #41
    JFo is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    393
    Hi Rain yes I have tried the wizard and I have tried creating it numerous times with different names and many different coding, no matter what I do it can not find the sub form

    The forms name is frmEquipment and the sub form is frmEquipmentSub

    it gets caught at the command button to add new inspection every time

    Thanks

  12. #42
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Why is frmEquipment unbound.

    This is not part of my Tut.

  13. #43
    JFo is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    393
    I thought if I created an unbound form for main form, then I thought it should work as I can have all elements unbound and enter them into table that way except for equipmentID which is only thing handled by autonumber so I had subform bound to tblEquipment

  14. #44
    JFo is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    393
    sorry my mistake, I will try again

  15. #45
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    My mistake. It appears as though I posted an unfinished piece of work.

    Best go and have a look at the working model. It shows in design view the Record Source and the join between the Sub and Main forms.

    Look especially at the "Link Child Fields" and "Link Master Fields" in the properties of the sub Form.

    As I look further this is an unfinished piece of work as the name used are not uniform. I must have lost the completed versions.

    But the working model should help you out. Please excuse my misNaming of the various Forms.

Page 3 of 6 FirstFirst 123456 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Excess Resource (MSDB)
    By mei909 in forum Programming
    Replies: 1
    Last Post: 09-04-2011, 12:15 AM
  2. Need Direction
    By sabrish72 in forum Programming
    Replies: 5
    Last Post: 06-08-2011, 09:25 PM
  3. Some general direction
    By Darkglasses in forum Database Design
    Replies: 4
    Last Post: 02-20-2011, 02:38 PM
  4. Need Direction Parts Form
    By Deano in forum Forms
    Replies: 2
    Last Post: 01-22-2011, 06:01 AM
  5. Direction needed.....
    By EVS Director in forum Database Design
    Replies: 7
    Last Post: 06-22-2010, 05:10 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