Hi!
I want to create a form where the user selects a value from a combobox, press a command button and the action would then be registered with the value (from the combobox) and the current time in a seperate table. I'm using VBA code that's triggered when i press the command button.
My target table consists of: FixturID, Tidpunkt, DatumID (autonumber and primary key).
I understand that I shall not include the autonumber field in the VBA code for my autonumber to generate a value successfully. My code works as it should, as long as the FixturID is unique. As soon as I select a value that is already registered, then Access doesn't register a new post.
Does somebody know what's wrong? FixturID is a foreign key, but that shouldn't interfere?
Here is my code:
Private Sub Commandbutton_Click()
CurrentDb.Execute "INSERT INTO Datum (FixturID, Tidpunkt) VALUES (" & Fixid.Value & ", #" & (Text5.Value) & "#)"
End Sub
So, a summarized version of my question: How can I get access to register a new post even if an earlier post with the FixturID exists?
Thanks in advance!