Requery Refresh

R

Ruthless Artist

If I have a query with Criteria and it to only show records with Null. How
can I requery or refresh the form, so it won't go back to the first record?

I have a button that input Date() into a text box. In the query it hides the
records that have dates. I want to Requery the form so it hides the records,
but dosen't start from the begaining.

Thanks.
 
G

Guest

Hi Ruthless,

Can we have a bit more info please, include the SQL query code also.
Are you wanting the query to only show the results with Null dates? If so
what do you want the form to show, the last record with Null dates or a
specific record with a null date based on other criteria already entered to
the form?

TonyT..
 
R

Ruthless Artist

Field: ID, TODAYS DATE, DATE COMPLETE
Table: tablename tablename tablename
Sort
Show
Criteria:
Is Null

I have the form show only records that do not have a "DATE COMPLTE". I have
a button when clicked it put todays date in "DATE COMPLETE" I'm trying to
make it Requery to hide the record and going to next one without going back
to the begaining.

Thanks
 
G

Guest

Hi again,

Probably best to use an SQL Update code to add the date to the required
record in the table directly, as I don't know if your query is updateable or
not. Something like
strSQL = "UPDATE tablename SET [Date Complete] = #" & Me.MyDateField & "#
WHERE ID = " & Me.MyIDField & ""
db.Execute strSQL, dbFailOnError
Then use NextRecord command to show next query record in forms record source.

TonyT..
 
R

Ruthless Artist

Thanks. I went in a diffrent path. This what I setup up.


sql = "INSERT INTO [Complete] ([Pending ID], [Date Received from Sitel],
[Date Sold], [Branch], [Complete_by]) VALUES(" & _
Pending_ID & ", " & Request_Date & ", " & Date_Sold & ", " & Branch
& ", """ & get_UserName & """);"

doSQL sql
MsgBox ("Account has been sucessfully completed"), vbInformation, "Complete"



I have it insert the info into another table. Now I just need to make it
remove the info from the current records

Thanks.

TonyT said:
Hi again,

Probably best to use an SQL Update code to add the date to the required
record in the table directly, as I don't know if your query is updateable
or
not. Something like
strSQL = "UPDATE tablename SET [Date Complete] = #" & Me.MyDateField & "#
WHERE ID = " & Me.MyIDField & ""
db.Execute strSQL, dbFailOnError
Then use NextRecord command to show next query record in forms record
source.

TonyT..

Ruthless Artist said:
Field: ID, TODAYS DATE, DATE COMPLETE
Table: tablename tablename tablename
Sort
Show
Criteria:
Is Null

I have the form show only records that do not have a "DATE COMPLTE". I
have
a button when clicked it put todays date in "DATE COMPLETE" I'm trying to
make it Requery to hide the record and going to next one without going
back
to the begaining.

Thanks
 

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