Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Fri, 27 Jun 2008 22:42:45 -0400,    group: microsoft.public.access.modulescoding        back       


retreaving a value of a field   
I am trying to get value from a qry using a select function in access. need 
help with the coding. having trouble with the equal side of firstline
Thanks in advance
al
date: Fri, 27 Jun 2008 22:42:45 -0400   author:   AlTamres

Re: retreaving a value of a field   
forgot to ad code
Function Getfirstline2(Acode As Long) As String

Dim FirstLine As String

   Select Case Acode

        Case Is = 9
            FirstLine = "get value in a field [ea degree]in the same qry as 
[acode]"
        Case Is = 10
            FirstLine = [FC Degree]
        Case Is = 11
            FirstLine = "MM Degree"
        Case Is = 12
            FirstLine = "Exemplified"
        Case Is = 13
            FirstLine = "Null"

        End Select
            Getfirstline2 = FirstLine
End Function



"AlTamres"  wrote in message 
news:56F6ED59-FC91-4092-BE10-C86C480E531A@microsoft.com...
> I am trying to get value from a qry using a select function in access. 
> need help with the coding. having trouble with the equal side of firstline
> Thanks in advance
> al
date: Fri, 27 Jun 2008 22:52:19 -0400   author:   AlTamres

Re: retreaving a value of a field   
What does "same qry as [acode]" mean?

Can you use the DLookup function?
-- 
Marsh
MVP [MS Access]


AlTamres wrote:

>Function Getfirstline2(Acode As Long) As String
>
>Dim FirstLine As String
>
>   Select Case Acode
>
>        Case Is = 9
>            FirstLine = "get value in a field [ea degree]in the same qry as 
>[acode]"
>        Case Is = 10
>            FirstLine = [FC Degree]
>        Case Is = 11
>            FirstLine = "MM Degree"
>        Case Is = 12
>            FirstLine = "Exemplified"
>        Case Is = 13
>            FirstLine = "Null"
>
>        End Select
>            Getfirstline2 = FirstLine
>End Function
>
>"AlTamres"  wrote
>> I am trying to get value from a qry using a select function in access. 
>> need help with the coding. having trouble with the equal side of firstline
>> Thanks in advance
>> al
date: Fri, 27 Jun 2008 22:47:34 -0500   author:   Marshall Barton

Re: retreaving a value of a field   
the field data that I am trying is in the same qry as the acode number. for 
different acode numbers I want different field data. all the information for 
the report is in the
same qry
thanks al
"Marshall Barton"  wrote in message 
news:6tcb64tb07u52faa861c5agqjja908hop2@4ax.com...
> What does "same qry as [acode]" mean?
>
> Can you use the DLookup function?
> -- 
> Marsh
> MVP [MS Access]
>
>
> AlTamres wrote:
>
>>Function Getfirstline2(Acode As Long) As String
>>
>>Dim FirstLine As String
>>
>>   Select Case Acode
>>
>>        Case Is = 9
>>            FirstLine = "get value in a field [ea degree]in the same qry 
>> as
>>[acode]"
>>        Case Is = 10
>>            FirstLine = [FC Degree]
>>        Case Is = 11
>>            FirstLine = "MM Degree"
>>        Case Is = 12
>>            FirstLine = "Exemplified"
>>        Case Is = 13
>>            FirstLine = "Null"
>>
>>        End Select
>>            Getfirstline2 = FirstLine
>>End Function
>>
>>"AlTamres"  wrote
>>> I am trying to get value from a qry using a select function in access.
>>> need help with the coding. having trouble with the equal side of 
>>> firstline
>>> Thanks in advance
>>> al
>
date: Fri, 27 Jun 2008 23:58:17 -0400   author:   AlTamres

Re: retreaving a value of a field   
That did not clarify what you are trying to do.

What is the query with acode and the value you want to get?

What other query might be used?

What value are you trying to get?

How can you identify the record with the value you want to
get?

Please explain why you can not use DLookup.
-- 
Marsh
MVP [MS Access]


AlTamres wrote:

>the field data that I am trying is in the same qry as the acode number. for 
>different acode numbers I want different field data. all the information for 
>the report is in the same qry
>
>"Marshall Barton" wrote
>> What does "same qry as [acode]" mean?
>>
>> Can you use the DLookup function?
>>
>>
>> AlTamres wrote:
>>
>>>Function Getfirstline2(Acode As Long) As String
>>>
>>>Dim FirstLine As String
>>>
>>>   Select Case Acode
>>>        Case Is = 9
>>>            FirstLine = "get value in a field [ea degree]in the same qry 
>>> as [acode]"
>>>        Case Is = 10
>>>            FirstLine = [FC Degree]
>>>        Case Is = 11
						...
>>>        End Select
>>>            Getfirstline2 = FirstLine
>>>End Function
>>>
>>>"AlTamres"  wrote
>>>> I am trying to get value from a qry using a select function in access.
>>>> need help with the coding. having trouble with the equal side of 
>>>> firstline
date: Sat, 28 Jun 2008 08:41:10 -0500   author:   Marshall Barton

Re: retreaving a value of a field   
I sent you a email with the info and test db
al

"Marshall Barton"  wrote in message 
news:gafc64t89c7aqvclb7oj83pgpbg782h91t@4ax.com...
> That did not clarify what you are trying to do.
>
> What is the query with acode and the value you want to get?
>
> What other query might be used?
>
> What value are you trying to get?
>
> How can you identify the record with the value you want to
> get?
>
> Please explain why you can not use DLookup.
> -- 
> Marsh
> MVP [MS Access]
>
>
> AlTamres wrote:
>
>>the field data that I am trying is in the same qry as the acode number. 
>>for
>>different acode numbers I want different field data. all the information 
>>for
>>the report is in the same qry
>>
>>"Marshall Barton" wrote
>>> What does "same qry as [acode]" mean?
>>>
>>> Can you use the DLookup function?
>>>
>>>
>>> AlTamres wrote:
>>>
>>>>Function Getfirstline2(Acode As Long) As String
>>>>
>>>>Dim FirstLine As String
>>>>
>>>>   Select Case Acode
>>>>        Case Is = 9
>>>>            FirstLine = "get value in a field [ea degree]in the same qry
>>>> as [acode]"
>>>>        Case Is = 10
>>>>            FirstLine = [FC Degree]
>>>>        Case Is = 11
> ...
>>>>        End Select
>>>>            Getfirstline2 = FirstLine
>>>>End Function
>>>>
>>>>"AlTamres"  wrote
>>>>> I am trying to get value from a qry using a select function in access.
>>>>> need help with the coding. having trouble with the equal side of
>>>>> firstline
date: Sat, 28 Jun 2008 21:35:05 -0400   author:   AlTamres

Re: retreaving a value of a field   
On Jun 27, 9:52 pm, "AlTamres"  wrote:
> forgot to ad code
> Function Getfirstline2(Acode As Long) As String
>
> Dim FirstLine As String
>
>    Select Case Acode
>
>         Case Is = 9
>             FirstLine = "get value in a field [ea degree]in the same qry as
> [acode]"
>         Case Is = 10
>             FirstLine = [FC Degree]
>         Case Is = 11
>             FirstLine = "MM Degree"
>         Case Is = 12
>             FirstLine = "Exemplified"
>         Case Is = 13
>             FirstLine = "Null"
>
>         End Select
>             Getfirstline2 = FirstLine
> End Function
>
> "AlTamres"  wrote in message
>
> news:56F6ED59-FC91-4092-BE10-C86C480E531A@microsoft.com...
>
> > I am trying to get value from a qry using a select function in access.
> > need help with the coding. having trouble with the equal side of firstline
> > Thanks in advance
> > al

Why not create a lookup table of (Code, FirstLine) and then use a
query - use a left join between the first table and the Lookup table?
Use VBA as a LAST resort!  They're extremely slow.
date: Sun, 6 Jul 2008 18:59:26 -0700 (PDT)   author:   Piet Linden

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us