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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Filter



 
 
Thread Tools Display Modes
  #1  
Old December 18th, 2006, 10:29 PM posted to microsoft.public.access.forms
PHisaw
external usenet poster
 
Posts: 224
Default Filter

Hi,

I have the following code to prevent user going to new record when existing
record is not complete. I'm not sure it is being used on correct event, but
it is working somewhat the way I want. I have a main form "fSwithboard" with
a combo box to list Tech names - "Combo8". There is a subform in datasheet
view that list all jobs assigned to specific tech from Combo8. When the job
number is clicked it opens form "fGeneralInfo". All works well - now I've
added the strWhere and If statement. It will open the filtered form
"fInProgressReminderRepair", but not Tech specific to Combo8. It lists all
tech's with jobs that have StopTime as null.

What I'm trying to do is when they click onto a new job, this form will
popup to show they are still logged in on another job. I also want it to
show this when the database is closed out each evening.

Private Sub JobNumber_Click()

Dim strWhere As String
strWhere = "Forms!fSwitchboard!Combo8 = '" &
Forms!fInProgressReminderRepair!Tech & "'"

If IsNull(Forms!fInProgressReminderRepair!StopTime) Then
DoCmd.OpenForm "fInProgressReminderRepair", , , strWhere
Else

DoCmd.OpenForm "fGeneralInfo", , , "JobNumber=" & Me!JobNumber
End If

End Sub

If anyone will tell me how to revise this code to make it work properly, it
will be very much appreciated.
Thanks in advance,
Pam
  #2  
Old December 18th, 2006, 11:52 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 264
Default Filter


What I'm trying to do is when they click onto a new job, this form will
popup to show they are still logged in on another job. I also want it to
show this when the database is closed out each evening.


Why not use DCount and filter for open calls and TechID is a match?
Then if you get something other than zero, you open your form that's
not complete?

  #3  
Old December 19th, 2006, 01:20 AM posted to microsoft.public.access.forms
PHisaw
external usenet poster
 
Posts: 224
Default Filter

Thanks for the reply. I'm not familiar with using DCount. Mind explaining?

Pam

" wrote:


What I'm trying to do is when they click onto a new job, this form will
popup to show they are still logged in on another job. I also want it to
show this when the database is closed out each evening.


Why not use DCount and filter for open calls and TechID is a match?
Then if you get something other than zero, you open your form that's
not complete?


  #4  
Old December 19th, 2006, 04:49 PM posted to microsoft.public.access.forms
PHisaw
external usenet poster
 
Posts: 224
Default Filter

Since I couldn't get the strWhere to work in the original code, I have
changed process.

I created a separate form and query with the same info, but for the query I
placed in the critera grid "Forms!fSwitchboard!Combo8" to match the Tech to
the form.

It works partially the way I want it to. The form will open with null
StopTime if the tech forgot to sign out and limits to only his records, but
when the tech doesn't have any open time the form still opens and they have
to close an empty form.

Is there a way to prevent this from opening when there are no open StopTime
records? Also, I need to keep a form open for filtering on StopTime. How do
I open a hidden form when the switchboard opens?

Thanks for any help,
Pam

" wrote:


What I'm trying to do is when they click onto a new job, this form will
popup to show they are still logged in on another job. I also want it to
show this when the database is closed out each evening.


Why not use DCount and filter for open calls and TechID is a match?
Then if you get something other than zero, you open your form that's
not complete?


 




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 12:18 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.