If Field 1 = Field 2, then Field 3 = 1

Mr.Frost

New member
Local time
Today, 08:46
Joined
Oct 2, 2007
Messages
6
Greetings All,

I am hoping someone here may able to help me or point me in the right direction. I am a newbie when it comes to Access.

The issue I am having:

I am working on a project with my boss at work. We have a database which will collect user information, but we want to setup a field which we can report on down the track. The access database work my boss is doing and I am working on using asp maker to create a GUI for corporate staff to use.

The issue - We have 2 fields which are set to radio buttons (yes and no) we would like this to work on. If field1 and field2 are both yes, then we would like a counter in a third field and just to add a number 1 in that field. That is pretty much it in a nutshell.

I have tried playing with setting yes to =1 and no to = 0 but I am having little to no success (as previously mentioned, access isnt my strong point).

Any advise/ hints would be greatly appreciated.

Please let me know if you need more info!
 
If Field1 = True AND Field2 = True Then
Field3 = 1
End If
 
If Field1 = True AND Field2 = True Then
Field3 = 1
End If

wow, cheers for the fast response - excuse my ignorance, where does this go?

looks more like an excel string! Thanks Rural Guy!
 
I just noticed this thread is in the query area. It is a calculated value so you do not want to store the value but simply calculate it each time you need it. What value do you want in Field3 when the other two fields are not both true?
 
THis would be on the on current properties of your form
so each time the form is actived- looked at it re calculates the value

g
 
@ Rural Guy, Either a 0 or no response

@ GaryPanic - thanks to both you and RuralGuy, will give it a go tomorrow!
 
if you get stuck post it up and I'll have a go....
this is quite simple
 
If you are doing it in a query then a new field set to:
Field3:=IIF([Field1] AND [Field2],1,0)
 
If you are doing it in a query then a new field set to:
Field3:=IIF([Field1] AND [Field2],1,0)

I realised by re-reading a couple of post that this isnt a thread for general queries it refers to Access Queries.

To be able to export this to the web, I really need this issue added into a table, so that it checks the rule that if field one and field 2 = yes for the individual record, then mark a 1 in the field 3.

Sorry guys.. like I said not very savvy with this access game. Is anyone able to help me/ any mod able to move this to the Tables thread to save me double posting?

By the way Rural guy, my boss was able to get your field working, but its just not working 'right' for me to use in the web side of things.

Thanks again for your help.

I can host the file/ email if you like so I can explain what we are trying to do...

regards,
Steve
 
I presume you are entering this in via a form

then it needs to be on the after update properties of both fields
followed by a refresh (optional)

- This is based on an access b/base
anything else and I'll bail out
 
I presume you are entering this in via a form

then it needs to be on the after update properties of both fields
followed by a refresh (optional)

- This is based on an access b/base
anything else and I'll bail out

what needs to be on the after update properties? your code, rural guys codE?
apologies for my ignorance with this topic!

Would it be easier to upload the db so you can see what I mean?

Steve
 
Steve,
Are you saying that with the web you have no ability to run queries?
 
Ok the easy way to do this (not the correct way - just the easy way)
you need to have 2 possible 3 fields on your table
you already have a yes no field - now add another field for each of the two radio buttons
add these to your form but have them invisible

ok on the afterupdate properties of the button
which looks like ... you want code

nwo this extra field we have added - have if field = true then this (extrafield we have added) = 1
if field = false then 0
same for the other yes/n button

check the attached
 

Users who are viewing this thread

Back
Top Bottom