Visual Basic Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am trying to write a code for a form in my database to create a new record
while refreshing my query. I am a new user so I'm not sure where to find the
codes to do this. While seaching the help box I did find this code but I'm
not sure why its not working. ' Implicit
reference.Forms!Transactions!NewData

Could some tell me why its not working.

Thanks,
Keri
 
Hi Maurice,

Thank you very much.
I have seven colums to one record. I am tracking reports on a monthy bases.
In the area you have "" should I but the colum headings so I will be update
my form without losing the information that I already have saved since the
colums repeat.
 
Hi,

I am trying to write a code for a form in my database to create a new record
while refreshing my query. I am a new user so I'm not sure where to find the
codes to do this. While seaching the help box I did find this code but I'm
not sure why its not working. ' Implicit
reference.Forms!Transactions!NewData

Could some tell me why its not working.

Thanks,
Keri

Why on Earth are you trying to write code to do what a simple bound form in
Access does natively?

What's the context? Could you explain why you have rejected the "ordinary" way
to do this - or perhaps you just didn't realize that Access does this for you
already?

John W. Vinson [MVP]
 
Hi John,

I didn't know access could do it for me in my form. I'm not sure how with
mirco's I try looking at them today.

Thanks,
Keri
 
Hi John,

I look at the codes in mircos and found the requery button but nothing to
add new records on my form. I have a data bases I update with finanical
information on a monthly bases. To make it easyer to query to see if I have
all the information I needed I thought Access would be great. I have two
tables link one with the fixed information the other table with infomration
that I update on a monthly basis with out losing the information I already
have. Thats how I came up with the code to make a new record in my form. I
just thought it would be easy not compliated. Does it sound that way?

Thanks,
Keri
 
Hi John,

I look at the codes in mircos and found the requery button but nothing to
add new records on my form. I have a data bases I update with finanical
information on a monthly bases. To make it easyer to query to see if I have
all the information I needed I thought Access would be great. I have two
tables link one with the fixed information the other table with infomration
that I update on a monthly basis with out losing the information I already
have. Thats how I came up with the code to make a new record in my form. I
just thought it would be easy not compliated. Does it sound that way?

It's only complicated because YOU ARE CHOOSING TO MAKE IT COMPLICATED.

To get to the new record on a Form you can look in the lower left margin of
the form. By default there are a series of controls that look like

<| < [1233] > |> >*

These mean respectively "go to the first record", "go back a record", show (or
type) a record number, "go forward a record", "go to the last record", "go to
the new record".

You do NOT need to write a Macro to go to the new record.
You do NOT need to write code to go to the new record.
You just need to click with the mouse, or use the Records menu item on the
menu, or several other ways to do it.


John W. Vinson [MVP]
 
Hi John,

I figured out that I had a problem with the relationship between my two
tables. I have a query linking them. So now on my form I am able to create a
new record but I need to popluate the first three records from a single
table. This information will not change. The seond table will. I keep a
monthly record of when reports are recevied so this seem the easy way to set
up the database. I am right now looking a command box and combo boxs. To do
the combo box takes a long time. I thought there would be a quicker way to
aumotaly do this.
thanks,
keri

John W. Vinson said:
Hi John,

I look at the codes in mircos and found the requery button but nothing to
add new records on my form. I have a data bases I update with finanical
information on a monthly bases. To make it easyer to query to see if I have
all the information I needed I thought Access would be great. I have two
tables link one with the fixed information the other table with infomration
that I update on a monthly basis with out losing the information I already
have. Thats how I came up with the code to make a new record in my form. I
just thought it would be easy not compliated. Does it sound that way?

It's only complicated because YOU ARE CHOOSING TO MAKE IT COMPLICATED.

To get to the new record on a Form you can look in the lower left margin of
the form. By default there are a series of controls that look like

<| < [1233] > |> >*

These mean respectively "go to the first record", "go back a record", show (or
type) a record number, "go forward a record", "go to the last record", "go to
the new record".

You do NOT need to write a Macro to go to the new record.
You do NOT need to write code to go to the new record.
You just need to click with the mouse, or use the Records menu item on the
menu, or several other ways to do it.


John W. Vinson [MVP]
 
Hi John,

I figured out that I had a problem with the relationship between my two
tables. I have a query linking them. So now on my form I am able to create a
new record but I need to popluate the first three records from a single
table. This information will not change. The seond table will. I keep a
monthly record of when reports are recevied so this seem the easy way to set
up the database. I am right now looking a command box and combo boxs. To do
the combo box takes a long time. I thought there would be a quicker way to
aumotaly do this.
thanks,
keri

I'm sorry, I find this completely baffling.

"populate the first three records from a single table"??? First three records
of what? Another table? Are you storing the same data redundantly in two
tables?

If you'ld like to discuss the structure of your tables, please start a new
thread - but if what you have is working for you I won't stick my nose in!

John W. Vinson [MVP]
 
Hi John,

No I am not puting the same data in one table redundantly. I have two
tables combined in a query the second table is the information that I will be
updating on a monthly basis once I get it working right. The first table
just has the set information that will not change. the purpose to create
this data base was the excel files that I have are to large to use any more.

My question is if I have two tables link together in a query. Based on that
query I have made a form. The form has Project Name, Project Number, Date
Recevied, etc. I need to updated the date received and the money amount that
I'm tracking the project name and number stays the same. I want to make a
command button that automaicly copys the project name & number so I can easly
update the rest of form.
 
Sorry John I made a new thread thanks,

Keri said:
Hi John,

No I am not puting the same data in one table redundantly. I have two
tables combined in a query the second table is the information that I will be
updating on a monthly basis once I get it working right. The first table
just has the set information that will not change. the purpose to create
this data base was the excel files that I have are to large to use any more.

My question is if I have two tables link together in a query. Based on that
query I have made a form. The form has Project Name, Project Number, Date
Recevied, etc. I need to updated the date received and the money amount that
I'm tracking the project name and number stays the same. I want to make a
command button that automaicly copys the project name & number so I can easly
update the rest of form.
 
Keri said:
I have seven colums to one record. I am tracking
reports on a monthy bases. In the area you have ""
should I but the colum headings so I will be update
my form without losing the information that I already
have saved since the colums repeat.

Hunh?

Easy way to get details on a Command such as DoCmd.GoToRecord is to open any
module window, type the Command into a line (to make sure you don't cause
yourself problems later, you can put a ' at or near the beginning of the
line to make it a comment), place the cursor on the command, and press F1.

Though you managed to confuse me with "In the area you have "" should I but
the colum headings so I will be update my form without losing the
information that I already have saved since the colums repeat," The Help for
this command seemed reasonably clear.

Larry Linson
Microsoft Access MVP
 
Back
Top