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
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
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
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 >
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
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
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.