SQL within VB

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

B3gbie

Thread Starter
Joined
Nov 30, 2001
Messages
228
I'm trying to pass a value from a text box within one form to an SQL statement within another, upon clicking on cmdEdit the value is passed to a variable within a module (Which i think is now global) and the used within the second form.Private Sub

cmdEdit_Click()
AppointmentKey = txtAppKey.Text
frmEditApp.Show
End Sub

Dim sql As String
sql = "Select * From Appointments Where AppointmentKey = " & "'" & AppointmentKey & "'"

I cant get this to be accepted, any ideas why?
 

B3gbie

Thread Starter
Joined
Nov 30, 2001
Messages
228
It's ok now thanks, i put all the code in a module and read directly from the form. Works fine now.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top