Query Selection 
Author Message
 Query Selection

I am setting up a user interface and am trying to allow users to type
numbers into a field and automatically update the ConnectionString and
RecordSource.

The problem is that as soon as a user begins to type the new number in the
procedure begins.  I need to find a way to wait until the user tabs to the
next field.  (I have verified that the following works by using a command
button instead of a text field.

Regards,

P.S.  I am rather new at VB

Private Sub Text1_Change()
   Dim strJobID As String

   strJobID = Text1.Text
   Adodc1.ConnectionString = "Provider=MSDASQL.1;Password=*****;Persist
Security Info=True;User ID=*****;Data Source=PROGRESS"
   Adodc1.RecordSource = _
   "SELECT PUB.""Job"".""Job-ID"", PUB.""cust"".""cust-name"",
PUB.""Job"".""Job-Desc"" FROM { oj PUB.""Job"" LEFT OUTER JOIN PUB.""cust""
ON PUB.""Job"".""Cust-ID-Ordered-by"" = PUB.""cust"".""Cust-code"" } WHERE
(PUB.""Job"".""Job-ID"" =" & strJobID & ")"
   Adodc1.Refresh
End Sub



Wed, 01 Sep 2004 01:54:36 GMT  
 Query Selection
Never mind.. Found the answer..   I am using  Text1_LostFocus instead of
Text1_Change

Regards

Quote:
> I am setting up a user interface and am trying to allow users to type
> numbers into a field and automatically update the ConnectionString and
> RecordSource.

> The problem is that as soon as a user begins to type the new number in the
> procedure begins.  I need to find a way to wait until the user tabs to the
> next field.  (I have verified that the following works by using a command
> button instead of a text field.

> Regards,

> P.S.  I am rather new at VB

> Private Sub Text1_Change()
>    Dim strJobID As String

>    strJobID = Text1.Text
>    Adodc1.ConnectionString = "Provider=MSDASQL.1;Password=*****;Persist
> Security Info=True;User ID=*****;Data Source=PROGRESS"
>    Adodc1.RecordSource = _
>    "SELECT PUB.""Job"".""Job-ID"", PUB.""cust"".""cust-name"",
> PUB.""Job"".""Job-Desc"" FROM { oj PUB.""Job"" LEFT OUTER JOIN
PUB.""cust""
> ON PUB.""Job"".""Cust-ID-Ordered-by"" = PUB.""cust"".""Cust-code"" } WHERE
> (PUB.""Job"".""Job-ID"" =" & strJobID & ")"
>    Adodc1.Refresh
> End Sub



Wed, 01 Sep 2004 01:57:52 GMT  
 Query Selection
You may want to use the Text1_Validate event instead, which allows you to
prevent the user from leaving the field if the data is not valid...


Quote:
> Never mind.. Found the answer..   I am using  Text1_LostFocus instead of
> Text1_Change

> Regards


> > I am setting up a user interface and am trying to allow users to type
> > numbers into a field and automatically update the ConnectionString and
> > RecordSource.

> > The problem is that as soon as a user begins to type the new number in
the
> > procedure begins.  I need to find a way to wait until the user tabs to
the
> > next field.  (I have verified that the following works by using a
command
> > button instead of a text field.

> > Regards,

> > P.S.  I am rather new at VB

> > Private Sub Text1_Change()
> >    Dim strJobID As String

> >    strJobID = Text1.Text
> >    Adodc1.ConnectionString = "Provider=MSDASQL.1;Password=*****;Persist
> > Security Info=True;User ID=*****;Data Source=PROGRESS"
> >    Adodc1.RecordSource = _
> >    "SELECT PUB.""Job"".""Job-ID"", PUB.""cust"".""cust-name"",
> > PUB.""Job"".""Job-Desc"" FROM { oj PUB.""Job"" LEFT OUTER JOIN
> PUB.""cust""
> > ON PUB.""Job"".""Cust-ID-Ordered-by"" = PUB.""cust"".""Cust-code"" }
WHERE
> > (PUB.""Job"".""Job-ID"" =" & strJobID & ")"
> >    Adodc1.Refresh
> > End Sub



Wed, 01 Sep 2004 03:37:49 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Selection of update queries from a list box

2. Query based on multiple selection listbox

3. Mulitple Selection-Parameter queries

4. ListBox Selections in query

5. SQL selection on Queries

6. paragraph selection query

7. How to modify query base on field selection

8. Selection Criteria passed to Query in Access

9. How to modify query base on field selection

10. TreevView selection - hierarchical selection

11. Capturing the selection from HTML selection lists

12. how can I build 2 queries in 1 query(VB SQL query)

 

 
Powered by phpBB® Forum Software