Hmm, huge text in yr msg.
Ok, here we go.
First: you don't need to shift the BoundColumn property in order to read the
value of the columns of the combo.
You are *too* focussed on .Value property.
Here's an example of reading the columns.
txtAuthorsPhone.Text = cmbAuthorsInitials.Column(6)
So, in other words cmbAuthorsInitials.Column(9) will reflect Typist Intials.
In order to make some sort of generic type of code for you, you will need to
make some preparations.
Y'll have to think of a mechanism that transfers the values from the columns
to the textboxes, resp. the VBA variables.
One mechanism would be to have naming convention of the textboxes, coincide
with the index number of the columns
as explained above.
So the values of 9 columns have to be transfered to the textboxes.
This can be done, for instance by using a names for the textboxes like:
txtAuthorsInitials_1 through to txtAuthorsInitials_9
Textbox txtAuthorsInitials_1 will host author initials, txtAuthorsInitials_4
authors title, and txtAuthorsInitials_8 author's closing....etc
Now you can use a counter to make the match between the columns and the
textboxes, like:
Dim iCol As Integer
icol = cmbAuthorsInitials.ColumnCount
For x = 1 to icol
If Me.cmbAuthorsInitials.ListIndex = -1 Then
Me.Controls("txtAuthorsInitials_" & CStr(x).Value = _
cmbAuthorsInitials.Column(x - 1)
Else
MsgBox "Pls select an author"
End If
Next
'Note the IF test [Me.cmbAuthorsInitials.ListIndex = -1] ensures that there
is a selection
'you will have to ensure that for every column, there's a textbox
"txtAuthorsInitials_X" available!
'and note: columns index of the combobox runs 0 to number of columns minus 1
Hopefully, you can rewrite the code with little effort, ensuring what you
asked for: reduce retyping
Anyhow, I hope that you have got some ideas to automate.
Pls repost if you have difficulties optimising yr code, indicating where you
got stuck.
Good luck
Krgrds,
Perry
> Hi,
>
[quoted text clipped - 108 lines]
>
> End Sub
Kerri - 07 Feb 2007 19:35 GMT
> Hmm, huge text in yr msg.
> Ok, here we go.
[quoted text clipped - 166 lines]
>
> - Show quoted text -
Thank you, Perry, for taking the time to answer. I will try this and
let you know.