471,887 Members | 1,247 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,887 software developers and data experts.

dim null multiple fields...

I am using the function below to copy values in a field until it reaches the following a value that is <> null...it works fine(see vba below), however I need to accomplish a similar task to copy the next record from a different field and then paste it into the null values. Please assist!

EX: I want the null value in "FIELD TWO" to equal 3 from "FIELD ONE" and the second null from "FIELD TWO" to equal 5 etc.

1 7
3 8
5 10

Function monkeythought()
Dim u As String

Set Mydb = CurrentDb()
Set Myds = Mydb.OpenRecordset("Number")
Do While Not Myds.EOF
For Each myfld In Myds.Fields
If myfld.Name = "one" Then
If Myds(myfld.Name).Value <> "" Then
u = Myds(myfld.Name).Value
Myds(myfld.Name).Value = u
End If
End If

Next myfld


End Function
Jun 14 '07 #1
0 858

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

26 posts views Thread by Agoston Bejo | last post: by
5 posts views Thread by David Sworder | last post: by
6 posts views Thread by john | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.