easy question 
Author Message
 easy question

This one should be easy because I have never written an Access module before
and just need to get started.
I have a table with about 20 fields.  For each record I want to read in 2
fields and compare the 2 fields(not directly but through a formula).  How do
I open the table and record and assign the fields to variables?

I know enough vb that I should be able to do the rest.

Thanks,
Tom



Fri, 10 Jan 2003 03:00:00 GMT  
 easy question
I believe I just answered your question posted on 2:23 PM?

Steve



Quote:
>This one should be easy because I have never written an Access module before
>and just need to get started.
>I have a table with about 20 fields.  For each record I want to read in 2
>fields and compare the 2 fields(not directly but through a formula).  How do
>I open the table and record and assign the fields to variables?

>I know enough vb that I should be able to do the rest.

>Thanks,
>Tom



Fri, 10 Jan 2003 03:00:00 GMT  
 easy question
Here's some sample code.  I haven't tested it, but it should give you
the idea.

Public Function Testing()
'Access97
Dim db As database
Dim rs As Recordset
Dim var1 As Variant, var2 As Variant

   Set db = CurrentDb()
   Set rs = db.OpenRecordset("myTable", dbOpenTable)

   With rs
      If .EOF Or .BOF Then
         MsgBox "Sorry, boss. Ain't nothin' there!"
      Else
         While Not .EOF
            .Edit
            var1 = .Fields!fldName1
            var2 = .Fields!fldName2
            'do whatever processing necessary
            .Update
            .MoveNext
         Wend 'eof
      End If
   End With

   Set rs = Nothing
   Set db = Nothing
End Function

Quote:

> This one should be easy because I have never written an Access module before
> and just need to get started.
> I have a table with about 20 fields.  For each record I want to read in 2
> fields and compare the 2 fields(not directly but through a formula).  How do
> I open the table and record and assign the fields to variables?

> I know enough vb that I should be able to do the rest.

> Thanks,
> Tom



Fri, 10 Jan 2003 03:00:00 GMT  
 easy question

No, you did not.

Quote:
> I believe I just answered your question posted on 2:23 PM?

> Steve



> >This one should be easy because I have never written an Access module
before
> >and just need to get started.
> >I have a table with about 20 fields.  For each record I want to read in 2
> >fields and compare the 2 fields(not directly but through a formula).  How
do
> >I open the table and record and assign the fields to variables?

> >I know enough vb that I should be able to do the rest.

> >Thanks,
> >Tom



Sat, 11 Jan 2003 03:00:00 GMT  
 easy question

My mistake, did the other post cover your question? If not, please
come back...

Steve



Quote:
>No, you did not.


>> I believe I just answered your question posted on 2:23 PM?

>> Steve



>> >This one should be easy because I have never written an Access module
>before
>> >and just need to get started.
>> >I have a table with about 20 fields.  For each record I want to read in 2
>> >fields and compare the 2 fields(not directly but through a formula).  How
>do
>> >I open the table and record and assign the fields to variables?

>> >I know enough vb that I should be able to do the rest.



Sat, 11 Jan 2003 03:00:00 GMT  
 easy question

Everything is wonderful.  If I have any more questions I will post them.

Quote:
> My mistake, did the other post cover your question? If not, please
> come back...

> Steve



> >No, you did not.


> >> I believe I just answered your question posted on 2:23 PM?

> >> Steve



> >> >This one should be easy because I have never written an Access module
> >before
> >> >and just need to get started.
> >> >I have a table with about 20 fields.  For each record I want to read
in 2
> >> >fields and compare the 2 fields(not directly but through a formula).
How
> >do
> >> >I open the table and record and assign the fields to variables?

> >> >I know enough vb that I should be able to do the rest.



Sun, 12 Jan 2003 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. EASY EASY EASY question

2. help easy easy question

3. easy question

4. bitmaps, easy question

5. Public functions, easy question

6. Easy question

7. I'm sure that this is an easy question

8. help new to VBA, easy question

9. quick and easy question....please help!

10. How does A2K handle ASP - Many Easy Questions

11. easy question

12. Easiest question of the week...

 

 
Powered by phpBB® Forum Software