Sorry to call on you again, I've have a form that will sign in users from my access database. But the forms only recognise the users input in order to sign them in. Further on I'm adding more detail to the students data. But I don't know how to get the data from the text box on the sign in page over to where more data is added in order for this data to be put in the same row in my table. I hope that makes sense, any advice would be great.
Thanks
K

Javeed M ShaikhRank #839 · 2.7K reputationPosted Apr 16, 2013, 1:25 PM EDT
your sign in form
' this code will be on click of the login button
your second form
Katie B66 reputationPosted Apr 16, 2013, 1:29 PM EDT
Katie B66 reputationPosted Apr 16, 2013, 2:05 PM EDT
"INSERT INTO StudentDetails ([ModuleCode],[Modules],[Classes],) WHERE ID = '" + txtstudentid.Text + "'" +
"VALUES ('" + lstModCode.SelectedItem + "','" + lstboxModules.SelectedItem + "','" + lstboxClasses.SelectedItem + "')";
But each time I run it I get an "Syntax error on INSERT INTO statement. I tried swapping out comma, semi-colons etc but I cant see it's issue. I'm hoping to get the statement to add the modulecode etc to my database where the txt.studentidfield is equal to the id in my database.
Any help would be great. Thank you
Javeed M ShaikhRank #839 · 2.7K reputationPosted Apr 16, 2013, 3:34 PM EDT
"INSERT INTO StudentDetails ([ModuleCode],[Modules],[Classes]) WHERE ID = '" + txtstudentid.Text + "' VALUES ('" + lstModCode.SelectedItem + "','" + lstboxModules.SelectedItem + "','" + lstboxClasses.SelectedItem + "')";
Katie B66 reputationPosted Apr 16, 2013, 11:26 PM EDT
VulpesRank #55 · 29.2K reputationPosted Apr 17, 2013, 12:32 AM EDT
Katie B66 reputationPosted Apr 17, 2013, 12:39 AM EDT
thankyou, I noticed once I out the two lines together. I never thought of using an update statement. The module code and things in square brackets need adding to the table. I'd guess if I put an update statement directly underneath this then the insertion of the modules will relate to the update statement, if that makes any sense.....
VulpesRank #55 · 29.2K reputationPosted Apr 17, 2013, 12:58 AM EDT
Katie B66 reputationPosted Apr 17, 2013, 1:36 AM EDT
VulpesRank #55 · 29.2K reputationPosted Apr 17, 2013, 1:49 AM EDT
"WHERE ID = " + txtstudentid.Text;
Riddhi ValechaRank #794 · 2.9K reputationPosted Apr 17, 2013, 4:12 AM EDT
Can you share your code ?? I can debug and send it back....
Katie B66 reputationPosted Apr 17, 2013, 9:05 AM EDT
Javeed M ShaikhRank #839 · 2.7K reputationPosted Apr 17, 2013, 9:25 AM EDT