I've already imported a master Excel sheet into Access. Same format except that Access has an ID key field. No problem.
I'm doing this, because on the previous and helpful suggestions from a few of you, this app would perform a lot better
if its underlying data was a database - not a sheet - reason being, that there are 31,103 sheet rows of data and Excel runs slower in running code
with sheet data rhis large
Here's the issue. My current Excel app has large amounts of text in several different textboxes on one userform.
I can easily display multiple rows of sheet data in one userform in Excel with the following code which works great
to display multiple rows of sheet data in ONE textbox in Excel:
The application gets its data from Listbox1 in both Excel and Access. Up til now, I've only been able to figure out how to display one
row of data in the Access textbox.
The VBA Access code that does this is really simple - for only ONE row - the Selelected row in Listbox1:
- how simple is that!
As you can see in the images below only the Selected item of the Access Listbox1 displays
If I can display one item in Listbox1 of Access, shouldn't it be possible to display multiple rows as in Textbox1 of The Access Textbox1 as
in theExcel app with the same code ? - but Access is not recognizing the Excel code that does this when I copy and paste it to a button in Access:
Sorry of being too ling and wordy - I wanted to be complete in describing this issue.
Up til now, I've only been helped with Excel related questions - if this is more of an Access
question, please excuse the rant and let me know where I can get the right help. I need to find someone who knows both Access and Excel well enough to help me with this.
Please help if you can. Would be greatly appreciated.
cr
I'm doing this, because on the previous and helpful suggestions from a few of you, this app would perform a lot better
if its underlying data was a database - not a sheet - reason being, that there are 31,103 sheet rows of data and Excel runs slower in running code
with sheet data rhis large
Here's the issue. My current Excel app has large amounts of text in several different textboxes on one userform.
I can easily display multiple rows of sheet data in one userform in Excel with the following code which works great
to display multiple rows of sheet data in ONE textbox in Excel:
Code:
Private Sub ListBox1_Click()
Dim n As Long
n = ListBox1.ListIndex
Me.TextBox1.Value = ListBox1.List(n, 3) _
& vbCrLf _
& ListBox1.List(n + 1, 3) _
& vbCrLf _
& vbCrLf + ListBox1.List(n + 2, 3) _
& vbCrLf _
& vbCrLf + ListBox1.List(n + 3, 3) _
& vbCrLf _
& vbCrLf + ListBox1.List(n + 4, 3) _
& vbCrLf _
& vbCrLf + ListBox1.List(n + 5, 3) _
& vbCrLf _
& vbCrLf + ListBox1.List(n + 6, 3) _
& vbCrLf _
& vbCrLf + ListBox1.List(n + 7, 3) _
& vbCrLf _
& vbCrLf + ListBox1.List(n + 8, 3) _
& vbCrLf _
& vbCrLf + ListBox1.List(n + 9, 3) _
& vbCrLf _
& vbCrLf + ListBox1.List(n + 10, 3) _
& vbCrLf _
& vbCrLf + ListBox1.List(n + 11, 3) _
& vbCrLf _
row of data in the Access textbox.
The VBA Access code that does this is really simple - for only ONE row - the Selelected row in Listbox1:
Code:
Private Sub Command14_Click() 'Show record
If Listbox1.ListIndex = -1 Then
MsgBox "Nothing Selected!"
Exit Sub
End If
Me.Textbox1.Value = Me.Listbox1.Column(4, Listbox1.ListIndex)
End Sub
As you can see in the images below only the Selected item of the Access Listbox1 displays
If I can display one item in Listbox1 of Access, shouldn't it be possible to display multiple rows as in Textbox1 of The Access Textbox1 as
in theExcel app with the same code ? - but Access is not recognizing the Excel code that does this when I copy and paste it to a button in Access:
Code:
Excel code that works great:
Private Sub ListBox1_Click()
Dim n As Long
n = ListBox1.ListIndex
Me.TextBox1.Value = ListBox1.List(n, 3) _
& vbCrLf _
& ListBox1.List(n + 1, 3) _
& vbCrLf _
& vbCrLf + ListBox1.List(n + 2, 3) _
& vbCrLf _ ..etc
Sorry of being too ling and wordy - I wanted to be complete in describing this issue.
Up til now, I've only been helped with Excel related questions - if this is more of an Access
question, please excuse the rant and let me know where I can get the right help. I need to find someone who knows both Access and Excel well enough to help me with this.
Please help if you can. Would be greatly appreciated.
cr