I have a form in which a lot of data is related with the case number. What I want to achieve is when the user enters the case number all related information should be pulled from the linked tables and displayed in the texboxes and it works fine if I change the textbox into listbox and make the result appear in the rowsource of the list box.
If I change the list box back to textbox,
and change the command in the code below
from
Me.CLAIMEDCASEISSUES.RowSource = StrSQL
to
Me.CLAIMEDCASEISSUES = StrSQL
in the textbox I get the actual select statement displayed. How to get the result of the query displayed there.
Give below is my code
Private Sub CLAIMEDCASEID_AfterUpdate()
Dim StrSQL As String
If Mid(Me.CLAIMEDCASEID, 4, 1) = "-" Then
'And Me.CLAIMEDCASEISSUES = Null Then
StrSQL = "Select get_hearingissues(ABSHEARINGCASE.HEARINGCASEID)from " _
& "ABSHEARINGCASE WHERE ABSHEARINGCASE.HEARINGCASEID = '" & Me.CLAIMEDCASEID & "'"
Me.CLAIMEDCASEISSUES.RowSource = StrSQL
Else
StrSQL = "Select get_appealissues(ABSAPPEALSCASE.APPEALCASEID)from " _
& "ABSAPPEALSCASE WHERE ABSAPPEALSCASE.APPEALCASEID = '" & Me.CLAIMEDCASEID & "'"
Me.CLAIMEDCASEISSUES.RowSource = StrSQL
End If
End Sub
Any suggestions
If I change the list box back to textbox,
and change the command in the code below
from
Me.CLAIMEDCASEISSUES.RowSource = StrSQL
to
Me.CLAIMEDCASEISSUES = StrSQL
in the textbox I get the actual select statement displayed. How to get the result of the query displayed there.
Give below is my code
Private Sub CLAIMEDCASEID_AfterUpdate()
Dim StrSQL As String
If Mid(Me.CLAIMEDCASEID, 4, 1) = "-" Then
'And Me.CLAIMEDCASEISSUES = Null Then
StrSQL = "Select get_hearingissues(ABSHEARINGCASE.HEARINGCASEID)from " _
& "ABSHEARINGCASE WHERE ABSHEARINGCASE.HEARINGCASEID = '" & Me.CLAIMEDCASEID & "'"
Me.CLAIMEDCASEISSUES.RowSource = StrSQL
Else
StrSQL = "Select get_appealissues(ABSAPPEALSCASE.APPEALCASEID)from " _
& "ABSAPPEALSCASE WHERE ABSAPPEALSCASE.APPEALCASEID = '" & Me.CLAIMEDCASEID & "'"
Me.CLAIMEDCASEISSUES.RowSource = StrSQL
End If
End Sub
Any suggestions