Open frmRain in the attached.
N.B. NO Code at all.
Open frmRain in the attached.
N.B. NO Code at all.
The Label on the sub, EquipInspectID should be EquipmentID.
My mistake. I did this in a rush.
Hi Rain I appreciate your help no end, however I do not understand what is happening in your example at all.
I can see that I can add equipment to the inspection but I can't work out how to put it in my forms and how to do it with command buttons as I do not want any forms in my database in datasheet form or where users can touch the next record, last record, etc buttons down the bottom. I want all the flow to be handled through command buttons
I really want to add new inspection and then add equipment one by one where a form opens and then adds equipment and then opens checklist and after asks if you want to add another piece of equipment until the user selects to finish, is this possible?
Datasheet and continuous form view confuse me and without command buttons I can't really tell either
I suppose that is why I use code more is because I can see what is happening
Thanks again, I owe you big time
Well then change the Sub Form to Normal Form View and add all the code and buttons you want.
Up to you.
JFo
I am starting to feel that I am pushing my own Methods on you instead of letting you do what you want to do.
I have no right to do that and do appoligise.
I have given you a bunch of information that I believe has been of some help.
As you progress with this project you may find that the Tables need altering to suit things that were not conveyed or even thought of at the time. Naturally you will have to address this as and when required.
I have told you about Appending and Updating records. You will need some code to do this.
I suggest that you create smaller posts with specific questions so that you solve one problem at a time.
So for now it is good luck with the project. I am sure you will get there eventually.
No need for any apologies Rain, without your help I would be doing a lot more things incorrectly and I would not have got to this stage. I think I am almost at the point where I can visualise the end of the design. There will be more questions no doubt especially as I get into the data extraction however at a design level there is definitive things I know that I need to work out
- This current form adding to the junction table is still causing me grief, I will try again tomorrow, I am busy tonight
- coding to add everything to the results table for any given checklist (I have worked out how to loop and add all the individual answers (and equiptype) however that is all and the code I would love to get sorted is how to add ChecklistID and ChecklistAnswerID
- validation for the check-list and assigning default values (this is quite a big thing however I only need an example of each validation and default)
So I think my major thing is how to loop through for each checklist at the same time as extracting and hence inserting the values in the respective tables
I figure after I have got one form (check-list) sorted and have solved these problems then I can really start doing a lot more by myself and every day it feels like I can do just a little bit more
I appreciate everything you have done and the tips you have given I am extremely thankful
Cheers
Hi Rain trying to do this by myself and with help from others however another 6 hours today and still struggling with subforms. I have figured out a few things and it works ok in edit mode (which I disabled) however I can't work out at all how to add a new piece of equipment
it is entering the data correctly and the code is right to pass it back to subform combo box however I keep getting
The current field must match the join key <name> in the table that serves as the 'one' side of one-to-many relationship. (Error 3341)
This is when using frmAddEditEquipment
After opening frmMainMenu selecting values I want frmInspections to open with frmEquipment sub not visible until selecting to add equipment command then when sub is opened i should be able to click on add new equipment command and it should pass values back to the sub
then i should be able to open checklist and then add another piece of equipment without ever closing the form
this is really doing my head in
Attachment 4693
Thanks
It is the same issue however I can now enter equipdetails and everything to subform except add new piece of equipment updating I get error 3331
which microsoft says
This error occurs when the user is trying to edit a row based on a view or stored query that is based on more than one table.
So same problem for last 4 days even with subform
Also my database is getting too big to attach as well I even deleted all the tables/forms except the few required and it says it is 2.5mb so can't attach to this site is there a history or cache it is keeping? rar it is only 1mb
Have a good weekend I have posted my other questions for everyone
Thanks
Yes definitely an issue with cache/ history
my database is 7MB in full normal version
I created a version that is only essential forms/ tables for this question and this same version zips at 2.5MB with my original database so I exported all tables and now it is 60Kb, as attached
Thanks
Attachment 4694
I can't follow your code so I am of no help.
OK thanks, it is clear I am doing something wrong then it is this code from frmAddEditEquipment command button
With Forms!frmInspections!frmEquipment.Form!cmbEquipDet ails
.RowSource = _
"SELECT tblEquipment.EquipmentID, tblEquipment.EquipTypeID, tblEquipment.ClientID, tblEquipment.EquipmentNo, tblEquipment.Description" & _
" FROM tblEquipment" & _
" ORDER BY tblEquipment.EquipmentNo;" 'query for the list of available cities
.Requery
.Value = Me.txtEquipment 'tell Access to select the Equipment matching the textbox value
End With
I thought if I add new equipment then I can add to Inspection (the new equipmentID) with this code with current InspectionId, but access does not like it
Ideally I just want a user to open one inspection and then add all the equipment one by one
I will have to try a different way unless someone else can help, my 3 issues still stand
Thanks for having a look
Issue Resolved, I was going about things totally the wrong way it was already working and I was trying to go out of working form and back in when all I needed was a simple command button that added a new record
4 days and it took was a step back and a few beers on a Friday night to have the idea
Let me know if you have any ideas for my validation/ coding of other 2 parts this junction issue is resolved
I have got to learn access rather than trying to code it all for myself, frmAddEditEquipment is not required at all
Thanks