Solved

DB Grid data control

Posted on 1998-07-19
3
171 Views
Last Modified: 2010-05-03
I am having a problem with this code:

Private Sub Command1_Click()


Let Data1.recordsource = "SELECT * FROM [STUDENT QUERY] WHERE MAJOR=me!TEXT1.text"

Data1.Refresh


End Sub

The Data1.refresh gives me an error that says " to few perimiters, expected 1"  if I put me!text1 in 'me!text1' it is not going to the text box.  How do I make it recognize the text box.  If I say "WHERE MAJOR='CIS'" IT WORKS FINE, BUT I DO NOT WANT TO HARD CODE THIS.

Any suggestions?

Thanks
0
Comment
Question by:DAVIDH
  • 2
3 Comments
 

Author Comment

by:DAVIDH
ID: 1466210
Edited text of question
0
 
LVL 1

Accepted Solution

by:
HenryChanE earned 50 total points
ID: 1466211
Try to convert to this,

Let Data1.recordsource = "SELECT * FROM [STUDENT QUERY] WHERE MAJOR= '" & trim(me!TEXT1.text) & "'"

    Data1.Refresh

This method always work. If not, check that you string really contains something !
0
 

Author Comment

by:DAVIDH
ID: 1466212
THANK YOU!!!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question