Rabu, 22 Oktober 2014

Re: [MS_AccessPros] I need VBA code that sets the value of field “C” based on value of fields “A” and “B”

 

John thank you again.
 
Kambiz


On Sunday, October 19, 2014 2:42 PM, "John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:


 
That code looks fine to me, except you need to say something like:

If Me.FieldA = "Geico" And Me.FieldB = "Auto" Then

I assume you're testing and setting fields on a form.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Oct 19, 2014, at 8:36 PM, kenaf42@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Access 07, please help.
I need VBA code that sets the value of field "C" based on value of fields "A" and "B"

Example:
If field  A = "Geico"  and  field  B = "Auto" Then
field  C = "6Month"
Else
If field  A = "Geico"  and  field  B = "Cycle" Then
field  C = "12Month"
End If




__._,_.___

Posted by: Kambiz Afshartous <kenaf42@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

.

__,_._,___

Tidak ada komentar:

Posting Komentar