View Full Version : Forms


D-Fresh
06-08-2000, 04:02 AM
Ok, I have a big form where data is inputted. I have two basic questions here.

First is, I have an E-mail function attached to a submit button, that whenever you hit the button, it sends an E-Mail to a certain person. I have a field on the source table that has record #, and it is Autonumber. I have

Set MyDB = CurrentDB()
Set MyRecs = MyDB.OpenRecordset
("Adjustment Correction Table")

The field name in Adjustmen Correction Table is [Record #], how would I refer to the current record I'm working on as a variable.

The Second is this... I also have a check box, which sends a different E-mail if clicked. I have the function set to On Get Focus, which is what I assumed to be if the check box was clicked True. However, if I check it True, or Uncheck it false, it still sends the E-Mail. How could I get it to just send the E-Mail when I check the box true, not when it's unchecked false.

Thanks in Advance...

Doug

ericgeil
06-08-2000, 06:13 AM
Maybe I'm misunderstanding the first one, but if the field is in the source table for our form, it seems you could just use
me.[Record #]

2nd:
I would use the After Update event to avoid firing an email if someone tabs to the control. Or, I would put it in your submit button, so the two emails are submitted only when the user decides. Also, in your code, to determine if the box is checked use:
If me.check1.value = -1 then 'if its checked
'code
'to send
'email
end if

Hope this answers your questions....

Eric

D-Fresh
06-08-2000, 07:01 AM
Thanks a lot. That is exactly what I was looking for.

Doug