Maybe I am asking too much. I have a sample of my code. I want to be able to add a record in the form portion and then have the Table portion update to show the new record.
Maybe someone could see whats up.
It's running the Add and Delete sub's before the buttons are clicked. And if it inserts a record the values are blank.
--------------------
<html>
<%@ Language=VBScript%>
<head>
<title>New Patient</title>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Add_OnClick
Dim TheForm
Set TheForm = Document.ValidForm
If (TheForm.T1.Value) <> "" Then
<%' open SQL server database %>
<%Set Conn = server.CreateObject("ADODB.Connection"%>
<%Conn.Open "driver={SQL Server};server=myserver.com;uid=ID;pwd=pass;database=Universal1;"%>
<%Conn.Execute("INSERT INTO [syspat] (PFName,PLName) VALUES ('" & T1 & "','" & T2 & "')"%>
MsgBox "Thank you."
End If
End Sub
Sub Delete_OnClick
<%Conn.Execute("DELETE FROM [syspat] WHERE PFName = ''"%>
End sub
-->
</SCRIPT>
</head>
<body>
<table border="1" width="99%" height="80">
<tr>
<td width="35%" height="74">
<form name="ValidForm">
<p align="center">Add New Patients</p>
<p>Fname<input type="text" name="T1" size="20"><br>
Lname <input type="text" name="T2" size="20"><br>
Address <input type="text" name="T3" size="20"><br>
Address2 <input type="text" name="T4" size="20"><br>
City <input type="text" name="T5" size="20"><br>
State <input type="text" name="T6" size="5"><br>
Zip <input type="text" name="T7" size="14"><br>
Country<input type="text" name="T8" size="14"></p>
<p align="center"><input type="submit" value="AddNew" name="Add">
<input type="reset" value="Clear" name="Clear">
<input type="submit" value="Delete Blanks Records" name="Delete">
</form>
------------------------
TIA
DougP, MCP
Visit my WEB site to see how Bar-codes can help you be more productive
Maybe someone could see whats up.
It's running the Add and Delete sub's before the buttons are clicked. And if it inserts a record the values are blank.
--------------------
<html>
<%@ Language=VBScript%>
<head>
<title>New Patient</title>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Add_OnClick
Dim TheForm
Set TheForm = Document.ValidForm
If (TheForm.T1.Value) <> "" Then
<%' open SQL server database %>
<%Set Conn = server.CreateObject("ADODB.Connection"%>
<%Conn.Open "driver={SQL Server};server=myserver.com;uid=ID;pwd=pass;database=Universal1;"%>
<%Conn.Execute("INSERT INTO [syspat] (PFName,PLName) VALUES ('" & T1 & "','" & T2 & "')"%>
MsgBox "Thank you."
End If
End Sub
Sub Delete_OnClick
<%Conn.Execute("DELETE FROM [syspat] WHERE PFName = ''"%>
End sub
-->
</SCRIPT>
</head>
<body>
<table border="1" width="99%" height="80">
<tr>
<td width="35%" height="74">
<form name="ValidForm">
<p align="center">Add New Patients</p>
<p>Fname<input type="text" name="T1" size="20"><br>
Lname <input type="text" name="T2" size="20"><br>
Address <input type="text" name="T3" size="20"><br>
Address2 <input type="text" name="T4" size="20"><br>
City <input type="text" name="T5" size="20"><br>
State <input type="text" name="T6" size="5"><br>
Zip <input type="text" name="T7" size="14"><br>
Country<input type="text" name="T8" size="14"></p>
<p align="center"><input type="submit" value="AddNew" name="Add">
<input type="reset" value="Clear" name="Clear">
<input type="submit" value="Delete Blanks Records" name="Delete">
</form>
------------------------
TIA
DougP, MCP
Visit my WEB site to see how Bar-codes can help you be more productive