Query vs Form behavior

P

Patricia

I have a query where I have a date field that the users selects from a drop
down [Date]. Then there is another field on the query [Expr1] = [Date].
When I enter a new record on the query it automatically updates the [Expr1]
field. When I created a datasheet based on the query and enter a new record
it does not automaticallly update [Expr1] until I close the form and go back
in. How can you force it to update [Expr1] without closing the form.
 
H

hmadyson

In the AfterUpdate event of the Date field on the form, you could have code
to requery the Expr1 field. It would look like

Private Sub Date_AfterEvent()
Expr1.Requery
End if

I warn you against calling a field Date since that is also a function and a
data type in Access. You may be better off with a different name.

Please let me know if this was helpful and if you need more assistance.
 
P

Patricia

I had tried this and it is still not working,

hmadyson said:
In the AfterUpdate event of the Date field on the form, you could have code
to requery the Expr1 field. It would look like

Private Sub Date_AfterEvent()
Expr1.Requery
End if

I warn you against calling a field Date since that is also a function and a
data type in Access. You may be better off with a different name.

Please let me know if this was helpful and if you need more assistance.

Patricia said:
I have a query where I have a date field that the users selects from a drop
down [Date]. Then there is another field on the query [Expr1] = [Date].
When I enter a new record on the query it automatically updates the [Expr1]
field. When I created a datasheet based on the query and enter a new record
it does not automaticallly update [Expr1] until I close the form and go back
in. How can you force it to update [Expr1] without closing the form.
 
H

hmadyson

I am out of ideas, it may be helpful if you sent me your project (or at least
a small part of it, you can write to me at this address without the double
dashes
k--a--r--e--n--y--y--y--1--at--c--o--m--c--a--s--t--dot--n--e--t


Patricia said:
I had tried this and it is still not working,

hmadyson said:
In the AfterUpdate event of the Date field on the form, you could have code
to requery the Expr1 field. It would look like

Private Sub Date_AfterEvent()
Expr1.Requery
End if

I warn you against calling a field Date since that is also a function and a
data type in Access. You may be better off with a different name.

Please let me know if this was helpful and if you need more assistance.

Patricia said:
I have a query where I have a date field that the users selects from a drop
down [Date]. Then there is another field on the query [Expr1] = [Date].
When I enter a new record on the query it automatically updates the [Expr1]
field. When I created a datasheet based on the query and enter a new record
it does not automaticallly update [Expr1] until I close the form and go back
in. How can you force it to update [Expr1] without closing the form.
 
P

Patricia

Thanks, I have sent it to you

hmadyson said:
I am out of ideas, it may be helpful if you sent me your project (or at least
a small part of it, you can write to me at this address without the double
dashes
k--a--r--e--n--y--y--y--1--at--c--o--m--c--a--s--t--dot--n--e--t


Patricia said:
I had tried this and it is still not working,

hmadyson said:
In the AfterUpdate event of the Date field on the form, you could have code
to requery the Expr1 field. It would look like

Private Sub Date_AfterEvent()
Expr1.Requery
End if

I warn you against calling a field Date since that is also a function and a
data type in Access. You may be better off with a different name.

Please let me know if this was helpful and if you need more assistance.

:

I have a query where I have a date field that the users selects from a drop
down [Date]. Then there is another field on the query [Expr1] = [Date].
When I enter a new record on the query it automatically updates the [Expr1]
field. When I created a datasheet based on the query and enter a new record
it does not automaticallly update [Expr1] until I close the form and go back
in. How can you force it to update [Expr1] without closing the form.
 
P

Patricia

Thanks, I have sent it to you

hmadyson said:
I am out of ideas, it may be helpful if you sent me your project (or at least
a small part of it, you can write to me at this address without the double
dashes
k--a--r--e--n--y--y--y--1--at--c--o--m--c--a--s--t--dot--n--e--t


Patricia said:
I had tried this and it is still not working,

hmadyson said:
In the AfterUpdate event of the Date field on the form, you could have code
to requery the Expr1 field. It would look like

Private Sub Date_AfterEvent()
Expr1.Requery
End if

I warn you against calling a field Date since that is also a function and a
data type in Access. You may be better off with a different name.

Please let me know if this was helpful and if you need more assistance.

:

I have a query where I have a date field that the users selects from a drop
down [Date]. Then there is another field on the query [Expr1] = [Date].
When I enter a new record on the query it automatically updates the [Expr1]
field. When I created a datasheet based on the query and enter a new record
it does not automaticallly update [Expr1] until I close the form and go back
in. How can you force it to update [Expr1] without closing the form.
 
Top