|
-
Apr 18th, 2008, 04:19 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Using variable fields in recordset
How can I refer to a fields in a recordet using a variable
soemthing like rs!variable. Is this possible
-
Apr 18th, 2008, 04:46 PM
#2
Re: Using variable fields in recordset
Do you mean using a variable to get the data or do you mean when you refer to the data you already have in a recordset?
-
Apr 18th, 2008, 05:05 PM
#3
Thread Starter
Addicted Member
Re: Using variable fields in recordset
I guess both, I want to fetch the data and then update using the same method..
e.g
rs.Open "Select " & leavetype.Text & " from leavemaster where empid=" & empid.Text
rs1! & leavetype.Text=total
rs.update
-
Apr 18th, 2008, 05:18 PM
#4
Re: Using variable fields in recordset
Generally, you have many ways to refer to the field:
rs!FieldName
rs("FieldName")
rs.Fileds("FieldName")
rs.Fileds.Item("FieldName")
... ...
In this case the field name comes from another source, then use the second syntax:
rs(leavetype.Text)
Cannot use the first syntax.
-
Apr 18th, 2008, 05:25 PM
#5
Thread Starter
Addicted Member
Re: Using variable fields in recordset
awsome..that works..thanks
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
|