Please forgive my brainless questions. I have experiance with this stuff it's just been awhile since I put together a serious project.
Ok so now that I have my table and input form built and working very well at the moment. The form does just about everything that I want it to save for one thing. I need it to check for duplicate parts. All of our parts have a specific part number and serial number. Because of regulations two of the same part number never have a duplicate serial number. So what I am trying to do is to set up my form so that after the entry of the serial number the code will run a query and check for duplicates. I am having a hard time straighening out my code in my head proceedurally. I know that I am going to have to pass values from the form to the query and if memory serves that means setting up dims. I would like some one to please help guide me on what I need to do and work it into the code.
First dims. I need the query to see if the values from two differnt txt boxes match anything that is already in the dbase. I have a text box for part number and one for serial number. I'm thinking something like this:
Dim pn As String
Dim pn = txt_prt_number.Value
Dim sn As String
Dim sn = txt_sn.Value
I don't know if I need to declare my query or not, perhaps someone can help me with that one.
I think my SQL Statement will be something like the select count, but I'm not sure.
I know that I will need an If statement that checks to see if the count value is less than 1.
I need a little help on this one folks. Once I build this one the rest should be a piece of cake.
Ok so now that I have my table and input form built and working very well at the moment. The form does just about everything that I want it to save for one thing. I need it to check for duplicate parts. All of our parts have a specific part number and serial number. Because of regulations two of the same part number never have a duplicate serial number. So what I am trying to do is to set up my form so that after the entry of the serial number the code will run a query and check for duplicates. I am having a hard time straighening out my code in my head proceedurally. I know that I am going to have to pass values from the form to the query and if memory serves that means setting up dims. I would like some one to please help guide me on what I need to do and work it into the code.
First dims. I need the query to see if the values from two differnt txt boxes match anything that is already in the dbase. I have a text box for part number and one for serial number. I'm thinking something like this:
Dim pn As String
Dim pn = txt_prt_number.Value
Dim sn As String
Dim sn = txt_sn.Value
I don't know if I need to declare my query or not, perhaps someone can help me with that one.
I think my SQL Statement will be something like the select count, but I'm not sure.
I know that I will need an If statement that checks to see if the count value is less than 1.
I need a little help on this one folks. Once I build this one the rest should be a piece of cake.