|
-
Feb 18th, 2006, 12:38 AM
#1
Thread Starter
Lively Member
-
Feb 18th, 2006, 12:50 AM
#2
Hyperactive Member
Re: Is this the only way
on the textbox datafield property enter the datafield
dim ctrl as control
for each ctrl in controls
if typeof ctrl is textbox and not trim(ctrl.datafield) ="" then
ctrl.text=rs.fields(ctrl.datafield)
end if
next ctrl
-
Feb 18th, 2006, 01:04 AM
#3
Thread Starter
Lively Member
Re: Is this the only way
First of all thanks for the quick reply. I understand where to put the dim statement but I'm exactly sure where the rest of code would go. Could you please explain. Oh yeah I'm new to VB if you couldn't figure that out. By the way I am not using any data controls so there is nothing in the textbox data field.
Last edited by graphixphantix; Feb 18th, 2006 at 01:08 AM.
-
Feb 18th, 2006, 01:17 AM
#4
Hyperactive Member
Re: Is this the only way
you can assign a datafield in a textbox without datacontrols... or you can use tags
on the textbox tag property enter the datafield
dim ctrl as control
for each ctrl in controls
if typeof ctrl is textbox and not trim(ctrl.tag) ="" then
ctrl.text=rs.fields(ctrl.tag)
end if
next ctrl
-
Feb 18th, 2006, 01:40 AM
#5
Thread Starter
Lively Member
Re: Is this the only way
Thanks! that worked great but how do I apply that to my combo boxes....just replace the textbox with combobox
For Each ctrl In Controls
If TypeOf ctrl Is TextBox And Not Trim(ctrl.Tag) = "" Then
ctrl.Text = rs.Fields(ctrl.Tag)
End If
Next ctrl
I also trid to put rs.update to save changes when I click next but when I used previous button to go back it still had old values.
-
Feb 18th, 2006, 01:43 AM
#6
Hyperactive Member
Re: Is this the only way
I understand where to put the dim statement but I'm exactly sure where the rest of code would go. Could you please explain
what action are you trying to do??? you can set the datasouce of the text box to your recordset
dim ctrl as control
for each ctrl in controls
if typeof ctrl is textbox and not trim(ctrl.tag) ="" then
set ctrl.datasource=rs
ctrl.datafield=rs.fields(ctrl.tag)
end if
next ctrl
and in popoulating a combobox
do while not rs.eof
combo1.additem rs.fields("pconsonant").
rs.movenext
loop
-
Feb 18th, 2006, 10:28 AM
#7
Hyperactive Member
Re: Is this the only way
I also trid to put rs.update to save changes when I click next but when I used previous button to go back it still had old values.
check your recordset locktype
rs.LockType = adLockOptimistic
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|