A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Data not refreshing on form



 
 
Thread Tools Display Modes
  #1  
Old February 6th, 2008, 11:26 PM posted to microsoft.public.access.gettingstarted
joy
external usenet poster
 
Posts: 152
Default Data not refreshing on form

Hi, A beginner with Access who needs lots of help..
I've a form for users to enter, the fields are not bound to a table.
I would like to create a refresh button so that user can do another
addition. I've tried coding with
Me.Requery on the Refresh button but nothing happens. The current data stays.

I've also tried If Me.Dirty = True Then
Me.Dirty = False
End If

What else should I try?

Thanks Heaps, Joy




  #2  
Old February 6th, 2008, 11:50 PM posted to microsoft.public.access.gettingstarted
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Data not refreshing on form

Joy,
to use unbound form to do this, you need to create an append query that will
add the data from the controls on the form to the whichever table or tables
you want the data to go into.
Place a save button on the form.
Code the click event of the button to run the append query.

It is much more work to use unbound forms - you have to write code for
everything.
If you use bound forms, there is a lot of built in stuff that automatically
saves records. That makes it quicker and easier to use.
Bound forms are one of the main benefits of using Access.

How did you go with creating that bound form we discussed yesterday - are
there still some things that need fixing to make it work properly?

Jeanette Cunningham

"Joy" wrote in message
...
Hi, A beginner with Access who needs lots of help..
I've a form for users to enter, the fields are not bound to a table.
I would like to create a refresh button so that user can do another
addition. I've tried coding with
Me.Requery on the Refresh button but nothing happens. The current data
stays.

I've also tried If Me.Dirty = True Then
Me.Dirty = False
End If

What else should I try?

Thanks Heaps, Joy






  #3  
Old February 6th, 2008, 11:50 PM posted to microsoft.public.access.gettingstarted
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Data not refreshing on form

Joy

If I'm understanding your description, you have a form in which your users
enter data, but that form is not bound to a table.

So, how does Access know "where to stick it?"

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Joy" wrote in message
...
Hi, A beginner with Access who needs lots of help..
I've a form for users to enter, the fields are not bound to a table.
I would like to create a refresh button so that user can do another
addition. I've tried coding with
Me.Requery on the Refresh button but nothing happens. The current data
stays.

I've also tried If Me.Dirty = True Then
Me.Dirty = False
End If

What else should I try?

Thanks Heaps, Joy






  #4  
Old February 6th, 2008, 11:53 PM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Data not refreshing on form

On Wed, 6 Feb 2008 15:26:01 -0800, Joy wrote:

Hi, A beginner with Access who needs lots of help..
I've a form for users to enter, the fields are not bound to a table.
I would like to create a refresh button so that user can do another
addition. I've tried coding with
Me.Requery on the Refresh button but nothing happens. The current data stays.

I've also tried If Me.Dirty = True Then
Me.Dirty = False
End If

What else should I try?

Thanks Heaps, Joy




Well, Refresh reloads the data from the table to which the form is bound, and
Dirty applies when a bound control is updated. Neither is meaningful for an
unbound form.

Why are you using an unbound form, at all? What's the point in entering data
that will be displayed on screen while the form is open and never put anywhere
else - or do you have VBA code to take the data from the unbound form and put
it into tables? If so, why do it the hard way rather than simply using a bound
form?

Background please!

John W. Vinson [MVP]
  #5  
Old February 7th, 2008, 12:03 AM posted to microsoft.public.access.gettingstarted
joy
external usenet poster
 
Posts: 152
Default Data not refreshing on form

Hi Jeff

I made a typo mistake.. the fields are bound. I can't get it to refresh:-(

Thx Joy

"Jeff Boyce" wrote:

Joy

If I'm understanding your description, you have a form in which your users
enter data, but that form is not bound to a table.

So, how does Access know "where to stick it?"

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Joy" wrote in message
...
Hi, A beginner with Access who needs lots of help..
I've a form for users to enter, the fields are not bound to a table.
I would like to create a refresh button so that user can do another
addition. I've tried coding with
Me.Requery on the Refresh button but nothing happens. The current data
stays.

I've also tried If Me.Dirty = True Then
Me.Dirty = False
End If

What else should I try?

Thanks Heaps, Joy







  #6  
Old February 7th, 2008, 12:03 AM posted to microsoft.public.access.gettingstarted
joy
external usenet poster
 
Posts: 152
Default Data not refreshing on form

Hi Jeanette
I just realised I made a typo mistake... I did get the fields to be bound to
a table. All fields are now bound. Sorry!

Hence, my predicament now... its not refreshing :-( with the codes I tried

Thx Joy


"Jeanette Cunningham" wrote:

Joy,
to use unbound form to do this, you need to create an append query that will
add the data from the controls on the form to the whichever table or tables
you want the data to go into.
Place a save button on the form.
Code the click event of the button to run the append query.

It is much more work to use unbound forms - you have to write code for
everything.
If you use bound forms, there is a lot of built in stuff that automatically
saves records. That makes it quicker and easier to use.
Bound forms are one of the main benefits of using Access.

How did you go with creating that bound form we discussed yesterday - are
there still some things that need fixing to make it work properly?

Jeanette Cunningham

"Joy" wrote in message
...
Hi, A beginner with Access who needs lots of help..
I've a form for users to enter, the fields are not bound to a table.
I would like to create a refresh button so that user can do another
addition. I've tried coding with
Me.Requery on the Refresh button but nothing happens. The current data
stays.

I've also tried If Me.Dirty = True Then
Me.Dirty = False
End If

What else should I try?

Thanks Heaps, Joy







  #7  
Old February 7th, 2008, 12:04 AM posted to microsoft.public.access.gettingstarted
joy
external usenet poster
 
Posts: 152
Default Data not refreshing on form

Hi John

Typo mistake.. the controls are bound to a table.
Just that codes I used for refreshing the form is not working:-(

Thx Joy

"John W. Vinson" wrote:

On Wed, 6 Feb 2008 15:26:01 -0800, Joy wrote:

Hi, A beginner with Access who needs lots of help..
I've a form for users to enter, the fields are not bound to a table.
I would like to create a refresh button so that user can do another
addition. I've tried coding with
Me.Requery on the Refresh button but nothing happens. The current data stays.

I've also tried If Me.Dirty = True Then
Me.Dirty = False
End If

What else should I try?

Thanks Heaps, Joy




Well, Refresh reloads the data from the table to which the form is bound, and
Dirty applies when a bound control is updated. Neither is meaningful for an
unbound form.

Why are you using an unbound form, at all? What's the point in entering data
that will be displayed on screen while the form is open and never put anywhere
else - or do you have VBA code to take the data from the unbound form and put
it into tables? If so, why do it the hard way rather than simply using a bound
form?

Background please!

John W. Vinson [MVP]

  #8  
Old February 7th, 2008, 12:12 AM posted to microsoft.public.access.gettingstarted
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Data not refreshing on form

Joy,
If you have a save button on your bound form, you will need code to make the
record save.
The code is:

If Me.Dirty Then
Me.Dirty = False
End If

To add the code:
--in design view click the button
--on the properties dialog, fine the event called On Click
--click the button on the right side with the ellipsis (...)
--choose Code Builder
--between the Private Sub and the End Sub
--type the 3 lines of code at the top of this post.

However if you don't use a close button, and just use the redX at top RHS of
form, the data will save automatically.
If this doesn't work for you, post back with details.

Jeanette Cunningham

"Jeanette Cunningham" wrote in message
...
Joy,
to use unbound form to do this, you need to create an append query that
will add the data from the controls on the form to the whichever table or
tables you want the data to go into.
Place a save button on the form.
Code the click event of the button to run the append query.

It is much more work to use unbound forms - you have to write code for
everything.
If you use bound forms, there is a lot of built in stuff that
automatically saves records. That makes it quicker and easier to use.
Bound forms are one of the main benefits of using Access.

How did you go with creating that bound form we discussed yesterday - are
there still some things that need fixing to make it work properly?

Jeanette Cunningham

"Joy" wrote in message
...
Hi, A beginner with Access who needs lots of help..
I've a form for users to enter, the fields are not bound to a table.
I would like to create a refresh button so that user can do another
addition. I've tried coding with
Me.Requery on the Refresh button but nothing happens. The current data
stays.

I've also tried If Me.Dirty = True Then
Me.Dirty = False
End If

What else should I try?

Thanks Heaps, Joy








  #9  
Old February 7th, 2008, 01:07 AM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Data not refreshing on form

On Wed, 6 Feb 2008 16:04:01 -0800, Joy wrote:

Hi John

Typo mistake.. the controls are bound to a table.
Just that codes I used for refreshing the form is not working:-(


What's the Recordsource of the form? Please post the SQL.
What are the control sources of the fields you want refreshed?
What's your code?
Why do you need a Refresh at all? It wouldn't *routinely* be necessary.

John W. Vinson [MVP]
  #10  
Old February 7th, 2008, 01:14 AM posted to microsoft.public.access.gettingstarted
joy
external usenet poster
 
Posts: 152
Default Data not refreshing on form

Hi Jeanette,

Thanks for your help...The record in bound form is saving on to the table.
In the Save cmd button

I used the code you gave below:

If Me.Dirty Then
Me.Dirty = False
End If

But how should I get the form to refresh... so that when I hit the refresh
button, all data showing on form is cleared and I can use it to add
another..or what code should I use... as Me.Refresh does not work either:-(

Thanks Joy






"Jeanette Cunningham" wrote:

Joy,
If you have a save button on your bound form, you will need code to make the
record save.
The code is:

If Me.Dirty Then
Me.Dirty = False
End If

To add the code:
--in design view click the button
--on the properties dialog, fine the event called On Click
--click the button on the right side with the ellipsis (...)
--choose Code Builder
--between the Private Sub and the End Sub
--type the 3 lines of code at the top of this post.

However if you don't use a close button, and just use the redX at top RHS of
form, the data will save automatically.
If this doesn't work for you, post back with details.

Jeanette Cunningham

"Jeanette Cunningham" wrote in message
...
Joy,
to use unbound form to do this, you need to create an append query that
will add the data from the controls on the form to the whichever table or
tables you want the data to go into.
Place a save button on the form.
Code the click event of the button to run the append query.

It is much more work to use unbound forms - you have to write code for
everything.
If you use bound forms, there is a lot of built in stuff that
automatically saves records. That makes it quicker and easier to use.
Bound forms are one of the main benefits of using Access.

How did you go with creating that bound form we discussed yesterday - are
there still some things that need fixing to make it work properly?

Jeanette Cunningham

"Joy" wrote in message
...
Hi, A beginner with Access who needs lots of help..
I've a form for users to enter, the fields are not bound to a table.
I would like to create a refresh button so that user can do another
addition. I've tried coding with
Me.Requery on the Refresh button but nothing happens. The current data
stays.

I've also tried If Me.Dirty = True Then
Me.Dirty = False
End If

What else should I try?

Thanks Heaps, Joy









 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:37 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.