Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to insert into access from a select menu

Status
Not open for further replies.
Jun 5, 2006
40
Hey guys..

Here's what my delima is. I have 2 select menu's side by side and they work fine you can move one item from one to the other and thats what i want my problem comes into play where after you get the things into the left menu called CURRENTDEPT_ID how do i get them inserted into the data base. I have a field they need to go into and it needs go to by the departments_contact.DEPTCONTACT_ID and doctor_matrix_DEPTCONTACT_ID this data needs to go into the dr matrix table and check if there is anything there and if there is a record delete it and add a new one based on that DEPTCONTACT_ID and also if the user leaves the list blank it needs to go into the database in the doctor_matrix table and delete all instances with the DOC id the url is passing into the code. Also on another page i have an add section with the same thing how do i take the values and insert them into the doctor_matrix table based on what ones they put into the left menu

please help me i'm lost and have no idea where to go to next in this process!!!

Remember free things are fun but they can come with an emotional price tags..
 
How to Move Items from One List Box to Another List Box on a Data Access Page

How to Retrieve Selected Values from a Multiple Selection List Box in a Data Access Page

Some quick questions:
I saw you posted this in another forum and you mentioned you were talking about a web page. So, do you mean you are dealing with Data Access Pages (DAP'S)?
You state "I have 2 select menu's side by side" Are these comboboxes or listboxes? Are you moving one item or many items between them? Why are you moving right to left (this just feels strange to me)? And if you got this working in a DAP, I'm impressed. I'd like to see the VBScript you wrote. It seems that whatever is moved will create a NEW record in Departments_Contact table?
Maybe some of this code can help you:
(TO ADD NEW DATA TO A TABLE)
<SCRIPT language=vbscript event=onchange for=Parcel_Notes>
<!--
dim sSQL
sSQL = "INSERT INTO REAGLOG(ParcelID,FieldName,NewData,Person) VALUES('" & CINT(ParcelID.value) & "','Parcel_Notes','" & CSTR(Parcel_Notes.value) & "','" & CSTR(holdID) & "')"
MSODSC.Connection.Execute sSQL
-->
</SCRIPT>

(TO CHECK IF A RECORD EXISTS)
<SCRIPT language=vbscript event=onchange for=EmployeeID>
<!--
Set rs = CreateObject("ADODB.Recordset")
sqlSelect = _
"SELECT * FROM LogonInfo WHERE EmployID = '" & EmployeeID.value & "'"
rs.Open sqlSelect, MSODSC.Connection
If rs.EOF Then
EmployeeID.value = "(Access Denied)"
Else
holdID = document.all.item("EmployeeID").value
EmployeeID.value = "(You May Edit)"
End IF
rs.Close
Set rs = Nothing
-->
</SCRIPT>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top