I'm amazed! How did you do it in such a short time? Thank you very much, really. Now I carefully study everything so I can understand it and see how I can apply it to my database. Thanks again from the bottom of my heart
I have built so many examples and demos that I have lots of demo databases and do not have to build new things or have new ideas.I'm amazed! How did you do it in such a short time
Remember, this is just an example of some concepts. Not meant to be a real solution. There are lots of different ways to do that, so the more specific your real problem and needs the better suggestions we can give you.Now I carefully study everything so I can understand it and see how I can apply it to my database.
It is fully make believe and not really a working solution, just a demo of some concepts. I do not even know what kind of data the OP has.@MajP For now, you don't need to change your design, because it seems this works for the OP, and it's irrelevant to add complexity to a working solution. I will start a new thread on my own and will ask for your help later. Thanks in advance
It is make believe data and probably not a good choice. That could be determined by the real data fields. Healthier alternative is better example since that would be subjective if it is a substitution.
- Comparisons should be permanent. For example you have a "Cheaper Option", but productA can not always be cheaper than ProductB. Prices change based on a lot of factors. So the correct comparison should show Price, Then in the query that shows the results, you can sort the price to see which one is cheaper.
I definitely disagree that is the real world. It can be true, but can also not be true.In a real world situation, if ProductA is similar to ProductB and ProductB is similar to ProductC
Well, I was talking about the real world I live in (my profession). I'm glad to see there are different real worlds than mine.I definitely disagree that is the real world. It can be true, but can also not be true.
If this is the case, how would I do it?Well, I was talking about the real world I live in (my profession)
To prevent mixing different scenarios,, I'll explain my situation in a new thread.If this is the case, how would I do it?
For my part it is not necessary, because what I am looking for is what you expressed in the screenshots, that is, I think we are looking for the same thingTo prevent mixing different scenarios,, I'll explain my situation in a new thread.
Thanks.
I'd already posted a new help request before readying your comment.For my part it is not necessary, because what I am looking for is what you expressed in the screenshots, that is, I think we are looking for the same thing
I think I don't understand where I have to insert the msgbox in the code?Hard to see and debug. I would put a msgbox here in the code. That way you can ensure the function is called, and see that the sql is correct.
....
msgbox StrSql
debug.print strSql
CurrentDb.Execute strSql
...
if the function is being called this should also print the sql string to the immediate window. You can post that here.
When someone says a procedure does not work, I am assuming that means nothing happens. (no error message)I think I don't understand where I have to insert the msgbox in the code?
Private Function AssignRelation()
Dim prod1 As Long
Dim prod2 As Long
Dim strSql As String
prod1 = Me.Parent.ID
prod2 = Me.ID
strSql = "Insert into tblProductRelations (product1_ID_FK, Product2_ID_FK) values (" & prod1 & ", " & prod2 & ")"
Msgbox StrSql
Debug.print strSql
CurrentDb.Execute strSql
Me.Parent.subfrmRelations.Form.Requery
Me.Requery
End Function
I did "greedy code." Instead of checking if a relation exists, I applied a composite index to the table. I called it ID1_ID2 and made it consist of the two foreign key fields.I go back to A I see that the association with D appears twice, is this normal