how to set a code for cmdbuttons

R

Revned

Hello,
I have a form name [NewItem] bound for a query
and my query has this SQL
SELECT tblItem.ItemCode, tblItem.CategoryID, tblItem.ItemDescription,
tblItem.Price, tblItem.Taxrate, tblDrinkingWaterType.TypeCode,
tblDrinkingWaterType.TypeName
FROM tblDrinkingWaterType INNER JOIN tblItem ON
tblDrinkingWaterType.TypeName = tblItem.TypeName;

i created a cmdNewItem button,this would allow me to add new item on this form
i set the property to Allow Data Entry Allow Edits Allow Additions but no luck
is there anyway to handle this can anyone help me in how to write my codes
or reconstruct my SQL.

I want that when i click cmdNewItem button it will clears the form and ready
for data entry, i am using access 2003

thank you very much i appreciate all your of help
 
G

GBA

I want that when i click cmdNewItem button it will clears the form and ready
for data entry, i am using access 2003
*** the wizard that sets up a command button offers you a choice of actions
and one of them is to go to a new record.....



Revned said:
Hello,
I have a form name [NewItem] bound for a query
and my query has this SQL
SELECT tblItem.ItemCode, tblItem.CategoryID, tblItem.ItemDescription,
tblItem.Price, tblItem.Taxrate, tblDrinkingWaterType.TypeCode,
tblDrinkingWaterType.TypeName
FROM tblDrinkingWaterType INNER JOIN tblItem ON
tblDrinkingWaterType.TypeName = tblItem.TypeName;

i created a cmdNewItem button,this would allow me to add new item on this form
i set the property to Allow Data Entry Allow Edits Allow Additions but no luck
is there anyway to handle this can anyone help me in how to write my codes
or reconstruct my SQL.

I want that when i click cmdNewItem button it will clears the form and ready
for data entry, i am using access 2003

thank you very much i appreciate all your of help
 
R

Revned

i did not use the wizard it can not gives me the kind of automation i am
needed
can you show me how? im not a programmer and not an expert in write VBA coddes

thanks


GBA said:
I want that when i click cmdNewItem button it will clears the form and ready
for data entry, i am using access 2003
*** the wizard that sets up a command button offers you a choice of actions
and one of them is to go to a new record.....



Revned said:
Hello,
I have a form name [NewItem] bound for a query
and my query has this SQL
SELECT tblItem.ItemCode, tblItem.CategoryID, tblItem.ItemDescription,
tblItem.Price, tblItem.Taxrate, tblDrinkingWaterType.TypeCode,
tblDrinkingWaterType.TypeName
FROM tblDrinkingWaterType INNER JOIN tblItem ON
tblDrinkingWaterType.TypeName = tblItem.TypeName;

i created a cmdNewItem button,this would allow me to add new item on this form
i set the property to Allow Data Entry Allow Edits Allow Additions but no luck
is there anyway to handle this can anyone help me in how to write my codes
or reconstruct my SQL.

I want that when i click cmdNewItem button it will clears the form and ready
for data entry, i am using access 2003

thank you very much i appreciate all your of help
 
G

GBA

1st: take your sql code and make a stand alone query with it...if it is not
already; let's call this query A. Run Query A. Can you update it with a new
record?? You may not be able to because it contains a join of two tables.
It depends on the key's and whether or not there is a fixed relationship
between the two. Look up "updateable queries" on this site or MVP site for
the logic on this issue.

if your query is not update-able then nothing you do in the form will change
that.

if your qurey is update-able then make a new button using the wizard to
instruct it to go to new record.


Revned said:
i did not use the wizard it can not gives me the kind of automation i am
needed
can you show me how? im not a programmer and not an expert in write VBA coddes

thanks


GBA said:
I want that when i click cmdNewItem button it will clears the form and ready
for data entry, i am using access 2003
*** the wizard that sets up a command button offers you a choice of actions
and one of them is to go to a new record.....



Revned said:
Hello,
I have a form name [NewItem] bound for a query
and my query has this SQL
SELECT tblItem.ItemCode, tblItem.CategoryID, tblItem.ItemDescription,
tblItem.Price, tblItem.Taxrate, tblDrinkingWaterType.TypeCode,
tblDrinkingWaterType.TypeName
FROM tblDrinkingWaterType INNER JOIN tblItem ON
tblDrinkingWaterType.TypeName = tblItem.TypeName;

i created a cmdNewItem button,this would allow me to add new item on this form
i set the property to Allow Data Entry Allow Edits Allow Additions but no luck
is there anyway to handle this can anyone help me in how to write my codes
or reconstruct my SQL.

I want that when i click cmdNewItem button it will clears the form and ready
for data entry, i am using access 2003

thank you very much i appreciate all your of help
 
R

Revned

thanks GBA



GBA said:
1st: take your sql code and make a stand alone query with it...if it is not
already; let's call this query A. Run Query A. Can you update it with a new
record?? You may not be able to because it contains a join of two tables.
It depends on the key's and whether or not there is a fixed relationship
between the two. Look up "updateable queries" on this site or MVP site for
the logic on this issue.

if your query is not update-able then nothing you do in the form will change
that.

if your qurey is update-able then make a new button using the wizard to
instruct it to go to new record.


Revned said:
i did not use the wizard it can not gives me the kind of automation i am
needed
can you show me how? im not a programmer and not an expert in write VBA coddes

thanks


GBA said:
I want that when i click cmdNewItem button it will clears the form and ready
for data entry, i am using access 2003

*** the wizard that sets up a command button offers you a choice of actions
and one of them is to go to a new record.....



:

Hello,
I have a form name [NewItem] bound for a query
and my query has this SQL
SELECT tblItem.ItemCode, tblItem.CategoryID, tblItem.ItemDescription,
tblItem.Price, tblItem.Taxrate, tblDrinkingWaterType.TypeCode,
tblDrinkingWaterType.TypeName
FROM tblDrinkingWaterType INNER JOIN tblItem ON
tblDrinkingWaterType.TypeName = tblItem.TypeName;

i created a cmdNewItem button,this would allow me to add new item on this form
i set the property to Allow Data Entry Allow Edits Allow Additions but no luck
is there anyway to handle this can anyone help me in how to write my codes
or reconstruct my SQL.

I want that when i click cmdNewItem button it will clears the form and ready
for data entry, i am using access 2003

thank you very much i appreciate all your of help
 

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