Blank Queries with function Attachments 
Author Message
 Blank Queries with function Attachments

Here is my problem.  I created a query in Access.  In that
query in the criteria field I enter Retest - ISS* and data
gets pulled up.  I'm trying to code it in VBA so that i
can select from a drop box and from the drop box you can
select Retest - ISS* or Retest - INT*.  Here is my code

Public Function get_ReTestName() As String

get_ReTestName = ReTestName

End Function

get_ReTestName is now currently in the criteria field but
when i do it this way i get nothing.  

The following code I hardcoded to try to trouble shoot the
problem but I still get nothing..... here it is

Public Function get_ReTestName() As String
ReTestName = " """ & "Retest - ISS*" & """ "
MsgBox ReTestName
get_ReTestName = ReTestName

End Function

Let me know if you may have a solution.

Thanks,
tony
.



Wed, 23 Feb 2005 02:02:52 GMT  
 Blank Queries with function Attachments
Try this (untested aircode):

Dim stRetest as String
Dim stSQL as String

stReTest = Me.ComboBox
stSQL = "Select * From MyTable " _
   & "Where ReTest = '" & stRetest & "'"

DoCmd.RunSQL stSQL

HTH
Tim Hansen

========================

Quote:
>-----Original Message-----
>Here is my problem.  I created a query in Access.  In
that
>query in the criteria field I enter Retest - ISS* and
data
>gets pulled up.  I'm trying to code it in VBA so that i
>can select from a drop box and from the drop box you can
>select Retest - ISS* or Retest - INT*.  Here is my code

>Public Function get_ReTestName() As String

>get_ReTestName = ReTestName

>End Function

>get_ReTestName is now currently in the criteria field but
>when i do it this way i get nothing.  

>The following code I hardcoded to try to trouble shoot
the
>problem but I still get nothing..... here it is

>Public Function get_ReTestName() As String
>ReTestName = " """ & "Retest - ISS*" & """ "
>MsgBox ReTestName
>get_ReTestName = ReTestName

>End Function

>Let me know if you may have a solution.

>Thanks,
>tony
>..

>.



Wed, 23 Feb 2005 02:55:21 GMT  
 Blank Queries with function Attachments
Tim, you cannot execute a SELECT statement.

Tony, consider using a parameter at that spot.
--

Regards,
Bas Cost Budde
--

Quote:

>Try this (untested aircode):
>stSQL = "Select * From MyTable " _
>   & "Where ReTest = '" & stRetest & "'"
>DoCmd.RunSQL stSQL
>>Here is my problem.  I created a query in Access.  In that
>>query in the criteria field I enter Retest - ISS* and data
>>gets pulled up.



Wed, 23 Feb 2005 04:28:39 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Inserting a Blank into a Query

2. Need Query help with blank fields

3. function used in query repeats for each query value

4. Deleting blank lines (including blank table row)

5. email function with attachments -- new error

6. email function with attachments

7. Round Function without attachment

8. Question about User Object increasing in CDO's Attachment function

9. Nested Attachments / Forwarded Attachments

10. Q: Attachment: How to insert filename of attachment in message body

11. add name of attachment to Subject line and delete attachment

12. How to get at attachments within attachments?

 

 
Powered by phpBB® Forum Software