B
Brian
Hey everyone,
here's my problem. I have a two column combobox. I will
have one column hidden. One of the columns will get it's
data from a table which has path's to various files. For
the second column, I want just the filenames, not the whole
path. here's teh code so far
Private Sub Form_Current()
Dim fn As Integer
Dim beg As Integer
Attachments.RowSource = "SELECT DISTINCTROW
[Attachments].[" & FRACA.Value & "] FROM [Attachments]"
x = 0
Do Until x = Attachments.ListCount
beg = 0
fn = 1
Do While fn <> 0
fn = InStr(beg + 1, Attachments.Column(0, x), "\")
If fn = 0 Then
Exit Do
Else
beg = fn
End If
Loop
Attachments.Column(1, x) =
Right(Attachments.Column(0, x), Len(Attachments.Column(0,
x)) - beg)
x = x + 1
Loop
Attachments.RowSource = comboarray
End Sub
problem is that i can't get that second column worth of
data to be stored. I get an error "Object not found" or
s/th like that. the row source gets set properly, and teh
second column is just a modified version of the first
colunn. any ideas on how to help me out here? thanks.
here's my problem. I have a two column combobox. I will
have one column hidden. One of the columns will get it's
data from a table which has path's to various files. For
the second column, I want just the filenames, not the whole
path. here's teh code so far
Private Sub Form_Current()
Dim fn As Integer
Dim beg As Integer
Attachments.RowSource = "SELECT DISTINCTROW
[Attachments].[" & FRACA.Value & "] FROM [Attachments]"
x = 0
Do Until x = Attachments.ListCount
beg = 0
fn = 1
Do While fn <> 0
fn = InStr(beg + 1, Attachments.Column(0, x), "\")
If fn = 0 Then
Exit Do
Else
beg = fn
End If
Loop
Attachments.Column(1, x) =
Right(Attachments.Column(0, x), Len(Attachments.Column(0,
x)) - beg)
x = x + 1
Loop
Attachments.RowSource = comboarray
End Sub
problem is that i can't get that second column worth of
data to be stored. I get an error "Object not found" or
s/th like that. the row source gets set properly, and teh
second column is just a modified version of the first
colunn. any ideas on how to help me out here? thanks.