Greetings,
I have a registration database that adds members to a members database then to a registration database. There are 8 possible registrants. My questions is, how can I do this dynamcially without having eight different SQL statements? Here's the code. It's all very clunky and cumbersome, but I don't know how to do it any other way:
(strLName could be strLName 1 through 8)
strSQL = "insert into members (MemPrcID,MemLastName,MemFirstName,MemMI,MemAddr1,MemAddr2,MemCity,MemState,MemZip,MemPhone,MemFax,MemEmail) values('" & strPrcID & "','" & strLName & "','" & strFName & "','" & strMI & "','" & strAddr1 & "','" & strAddr2 & "','" & strCity & "','" & strState & "','" & strZip & "','" & strPhone & "','" & strFax & "','" & strEmail & "')"
objConn.Execute(strSQL)
strSQL2 = "Select * from members where MemPrcID = '" & strPrcID & "' and MemLastName= '" & strLName & "'"
objConn.Execute(strSQL2)
Set oRs2 = objConn.Execute(strSQL2)
strMemID=oRs2("MemID"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
strSQL3 = "insert into registrations (RegPrcID,RegMemID,RegPrgID,RegFeeCharged,RegSource,RegBillToID) values('" & strPrcID & "','" & strMemID & "','" & strPrgID & "','" & strPrgFee & "','9','" & strPrcID & "')"
objConn.Execute(strSQL3)
Any thoughts or suggestions would be greatly appreciated. Thank you very much.
I have a registration database that adds members to a members database then to a registration database. There are 8 possible registrants. My questions is, how can I do this dynamcially without having eight different SQL statements? Here's the code. It's all very clunky and cumbersome, but I don't know how to do it any other way:
(strLName could be strLName 1 through 8)
strSQL = "insert into members (MemPrcID,MemLastName,MemFirstName,MemMI,MemAddr1,MemAddr2,MemCity,MemState,MemZip,MemPhone,MemFax,MemEmail) values('" & strPrcID & "','" & strLName & "','" & strFName & "','" & strMI & "','" & strAddr1 & "','" & strAddr2 & "','" & strCity & "','" & strState & "','" & strZip & "','" & strPhone & "','" & strFax & "','" & strEmail & "')"
objConn.Execute(strSQL)
strSQL2 = "Select * from members where MemPrcID = '" & strPrcID & "' and MemLastName= '" & strLName & "'"
objConn.Execute(strSQL2)
Set oRs2 = objConn.Execute(strSQL2)
strMemID=oRs2("MemID"
strSQL3 = "insert into registrations (RegPrcID,RegMemID,RegPrgID,RegFeeCharged,RegSource,RegBillToID) values('" & strPrcID & "','" & strMemID & "','" & strPrgID & "','" & strPrgFee & "','9','" & strPrcID & "')"
objConn.Execute(strSQL3)
Any thoughts or suggestions would be greatly appreciated. Thank you very much.