Thank you for your reply
I've managed to achieve what I wanted by useing
Private Sub txtURN_KeyPress(KeyAscii As Integer)
If (KeyAscii = 13) Then
Call cmdURNSearch_Click
End If
End Sub
I
I have a form with a text box in and a command button.
At the moment a user types something in the text box and then clicks the button.
is there a way that rather than having to click the button I can automatically detect if the enter key has been pressed, and then do the command button ?
Can anyone help me I have seriously messed up my SQL Security on my local SQL server. i am trying to set it back but I cant. i tried Deleting my sql Server registration, then adding it again, but that didn't work.
what I did was change it to SQL and windows authentication, however, when I try...
Can anyone help me I have seriously messed up my SQL Security on my local SQL server. i am trying to set it back but I cant. i tried Deleting my sql Server registration, then adding it again, but that didn't work.
what I did was change it to SQL and windows authentication, however, when I try...
i have a SQL statement that i am passing via VB, but for some reason I am getting an error saying that there is a missing operator in string, and yet when i run the statement I am trying to pass in the sql query analyser, it works perfect, has anyone any idea's why?
Dim sSQL As String
sSQL =...
if i have already set a connection up to my server
can i then use this in vb to execute a stored proceedure
dim str as string
str = cnn.Execute sp_GetPCON 'input parameter'
so that str will now contain the output parameter of my stored proceedure, or do i have to set up a command object?
can anyone spot what I am doing wrong here, i think it is becasue of the quotes I am using, but cant work out how to put them
I am using this
sSQL = "Select * from V_SOAPostCodeSearch where PCID Like '" & sPostcode & "*'"
which gives me this
Select * from V_SOAPostCodeSearch where PCID Like...
can anyone point me in the right direction, having spent the past 3 hours looking at this, I am going up the wall.
I am working on a database that someone else has set up. the vb front end is connection to SQL 2000, using a DSB.
its been set up so that the database connection is created once...
i am using the following proceedure to fill a combo box on my form.
Public Sub FillCombo(objComboBox As ComboBox, strSQL As String, strFieldToShow As String, Optional strFieldForItemData As String)
Dim rs As New ADODB.Recordset 'Load the data
Set rs = GetRecordset(strSQL)
With objComboBox...
I've had a look on the net, and found a sub that someone had written that does what I want
Shuld anyone else want it, it is
Public Sub MyResetControls(frmMyForm As Form)
On Error GoTo Err
Dim Control As Object
For Each Control In frmMyForm.Controls
Control.Text = ""...
i have various forms in my database that as I select a project, will fill all the field on the form.
Rather than writing
FieldA= ""
FieldB= ""
FieldC= ""
FieldD= ""
etc etc
everytime I have to clear the form, I thought I would write a function, where I passed in the form name, and then clear...
I am looking at a database that is in use the the company I work for.
on every from in the database is a print button, and behind it the code
On Error GoTo failure
Select Case Printer.Orientation
Case Is = vbPRORLandscape
Me.PrintForm
Printer.EndDoc
Case Is =...
got it
Private Sub CboCountries_Click()
With CboCountries
MsgBox .ItemData(.ListIndex), vbInformation
End With
End Sub
Private Sub Form_Initialize()
Dim sql As String
sql = "select * from T_country"
Dim rsCountries As New ADODB.Recordset
rsCountries.Open sql, cnn...
sorry, I have sorted the (0) out now, that was what was causing the problem.
you mentioned this line of code
.ItemData(.NewIndex) = rsCountries![CountryID]
what is it doing exactly? is it somehow saving the countryid in an array? or am I just wishfull thinking.
I am so used to using...
your guess is right, i want to show the countries, but store the country id.
I've just tried your code. I keep getting an error on the .clear saying Method or data member not found, do you know why this is?
if i create an array, how can i see this? ie i wanted to test it out with afterupdate...
Actually I think I have got it now, I changed it to
Dim sql As String
sql = "select * from T_country"
Dim rsCountries As New ADODB.Recordset
rsCountries.Open sql, cnn, adOpenStatic, adLockReadOnly
With Me.CboCountries(0)
.Clear
Do
.AddItem rsCountries![CountryID]...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.