Help --- input form only with option groups.

N

New_Access

Hi All,
I want to create a form where if it closed or a command
button is clicked it will cut the record and append it to a certain
query.So that every time the form is open, there always no record in it.
I also want to put an option group ( probably radio button ) on my form.
I want to keep it values in a query field but converted to a text ( just
like
combo box ).But if the user make no change to my form,there is no data
will be append,cause the default value of my option group is setted to 1.

Hope would like to advice cause I just have a very little experience with
VBA code.

Thank's before
 
O

OldPro

Hi All,
I want to create a form where if it closed or a command
button is clicked it will cut the record and append it to a certain
query.So that every time the form is open, there always no record in it.
I also want to put an option group ( probably radio button ) on my form.
I want to keep it values in a query field but converted to a text ( just
like
combo box ).But if the user make no change to my form,there is no data
will be append,cause the default value of my option group is setted to 1.

Hope would like to advice cause I just have a very little experience with
VBA code.

Thank's before

I am having difficulting understanding your problem. If a form
closes, you want a record appended to a query? Records are appended
to tables, not queries. And where does the record come from? Is this
form strictly for adding new records? What if the user fills in one
field, but not another? Do you want to save the one field in a new
record, or disallow it? You can use the BeforeUpdate event to add
code that checks the fields to see if the key ones have data using the
IsNull() function. The update can be canceled from there.
 
N

New_Access

Dear Oldpro,
Yeah you're right.
The data should be appended to a table not a query.And the form
strictly for adding new records only the user must be fill all the fields.
( especially 4 or 5 fields ) and my option group has a function to
shown or hide another 3 fields.

And I want from 3 hidden fields,the users have to fill them all,
or not one at all
But how to write the code..
Thank's before
 
O

OldPro

Dear Oldpro,
Yeah you're right.
The data should be appended to a table not a query.And the form
strictly for adding new records only the user must be fill all the fields.
( especially 4 or 5 fields ) and my option group has a function to
shown or hide another 3 fields.

And I want from 3 hidden fields,the users have to fill them all,
or not one at all
But how to write the code..
Thank's before







- Show quoted text -

Private Sub Form_BeforeUpdate()
If isNull(field1) or isNull(field2) or isNull(field3) then
Cancel = true
Endif
If option1=1 and (isNull(field4) or isNull(field5) then
Cancel = true
Endif
End Sub
 
L

Linq Adams via AccessMonster.com

"So that every time the form is open, there always no record in it."

Set the Form's Data Entry Property to "Yes"

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top