Time Calculations

I am trying to calculate "Start time" + "End Time" on a form in ACCESS 2007 

example: I started @ 3:00 am on tuesday and did not finishish until 5:00 pm 
on saturday.
How do I make a calculaution to give me a total for this?

what fields should be included in the datasheet and the form?
0
Utf
7/8/2007 1:10:00 AM
access 16762 articles. 3 followers. Follow

6 Replies
563 Views

Similar Articles

[PageSpeed] 6

Hi Craig,

Here are some articles that you may find helpful:

   On time and how much has elapsed
   http://office.microsoft.com/en-us/access/HA011102181033.aspx

   Using dates and times in Access
   http://office.microsoft.com/en-us/access/HA010546621033.aspx

   ACC2000: How to Calculate Daily Hours Based on Clock In/Clock Out Times
   http://support.microsoft.com/?id=237958
 
Note: Disregard the "ACC2000:" in the title of the third article. It should 
apply equally well to other versions of Access.


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

"Craig G." wrote:

> I am trying to calculate "Start time" + "End Time" on a form in ACCESS 2007 
> 
> example: I started @ 3:00 am on tuesday and did not finishish until 5:00 pm 
> on saturday.
> How do I make a calculaution to give me a total for this?
> 
> what fields should be included in the datasheet and the form?
0
Utf
7/8/2007 2:50:00 AM
"Craig G." <CraigG@discussions.microsoft.com> wrote in message
news:91ED8944-2D56-40FD-AF8A-9CA85C274E04@microsoft.com...
> I am trying to calculate "Start time" + "End Time" on a form in ACCESS 2007
>
> example: I started @ 3:00 am on tuesday and did not finishish until 5:00 pm
> on saturday.
> How do I make a calculaution to give me a total for this?
>
> what fields should be included in the datasheet and the form?

Craig G.,

You cannot perform a "Start Time" + "End Time" operation, not if "Start Time" and "End
Time" are Datetime values.

You can subtract them, "End Time" - "Start Time".

In VBA, you would do this:

Public Function ElapsedTimeFromDatetimes(StartDatetime As Date _
                                       , EndDatetime As Date) As String

  Dim TotalSeconds As Integer
  Dim ElapsedHours As Integer
  Dim ElapsedMinutes As Integer
  Dim ElapsedSeconds As Integer

  TotalSeconds = DateDiff("s", StartDatetime, EndDatetime)

  ElapsedHours = TotalSeconds \ 3600
  ElapsedMinutes = (TotalSeconds \ 60) Mod 60
  ElapsedSeconds = TotalSeconds Mod 60

  ElapsedTime = Format(CStr(ElapsedHours), "00") & ":" & _
                Format(CStr(ElapsedMinutes), "00") & ":" & _
                Format(CStr(ElapsedSeconds), "00")

  ElapsedTimeFromDatetimes = ElapsedTime

End Function

The function call would appear as:

ElapsedTimeFromDatetimes([StartDatetime], [EndDatetime])


In a single expression, you would use:

Format(DateDiff("s", [StartDatetime], [EndDatetime]) \ 3600, "00") & ":" &
Format(DateDiff("s", [StartDatetime], [EndDatetime]) \ 60 MOD 60, "00") & ":" &
Format(DateDiff("s", StartDatetime], [EndDatetime]) MOD 60, "00")


Sincerely,

Chris O.


0
Chris2
7/8/2007 7:29:23 PM
The generally agreed correct solution is to store the duration as number of 
seconds, and write your own functions to convert from seconds to hh:mm:ss 
and vice versa.

I did write about a kludge in my October, 2003 "Access Answers" column in 
Pinnacle Publication's "Smart Access". You can download the column (and 
sample database) for free at 
http://www.accessmvp.com/DJSteele/SmartAccess.html

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"pauld" <pauld@discussions.microsoft.com> wrote in message 
news:A427AF17-A90A-4F15-8F6F-0CF12FD5614F@microsoft.com...
> Tom,
>
> I need to calculate elapsed time in hours:minutes:seconds to score a race
> that usually exceeds 23:59:59.
>
> Is there a way to calculate this in Access ? It's simple in Excel by 
> setting
> the time format to 37:50:55 and all values over 23:59:59 calculate 
> properly.
>
> I know nothing about Visual Basic and hope there is a way to handle this
> with using my knowledge of Access. I want to use Access to do this since 
> the
> other important information about the race is in Access. We've figured out
> how to do everything else, but this one baffles us.
>
> "Tom Wickerath" wrote:
>
>> Hi Craig,
>>
>> Here are some articles that you may find helpful:
>>
>>    On time and how much has elapsed
>>    http://office.microsoft.com/en-us/access/HA011102181033.aspx
>>
>>    Using dates and times in Access
>>    http://office.microsoft.com/en-us/access/HA010546621033.aspx
>>
>>    ACC2000: How to Calculate Daily Hours Based on Clock In/Clock Out 
>> Times
>>    http://support.microsoft.com/?id=237958
>>
>> Note: Disregard the "ACC2000:" in the title of the third article. It 
>> should
>> apply equally well to other versions of Access.
>>
>>
>> Tom Wickerath
>> Microsoft Access MVP
>> https://mvp.support.microsoft.com/profile/Tom
>> http://www.access.qbuilt.com/html/expert_contributors.html
>> __________________________________________
>>
>> "Craig G." wrote:
>>
>> > I am trying to calculate "Start time" + "End Time" on a form in ACCESS 
>> > 2007
>> >
>> > example: I started @ 3:00 am on tuesday and did not finishish until 
>> > 5:00 pm
>> > on saturday.
>> > How do I make a calculaution to give me a total for this?
>> >
>> > what fields should be included in the datasheet and the form? 


0
Douglas
7/28/2007 10:00:45 PM
Chris2 wrote:
> "Craig G." <CraigG@discussions.microsoft.com> wrote in message
> news:91ED8944-2D56-40FD-AF8A-9CA85C274E04@microsoft.com...
> 
>>I am trying to calculate "Start time" + "End Time" on a form in ACCESS 2007
>>
>>example: I started @ 3:00 am on tuesday and did not finishish until 5:00 pm
>>on saturday.
>>How do I make a calculaution to give me a total for this?
>>
>>what fields should be included in the datasheet and the form?
> 
> 
> Craig G.,
> 
> You cannot perform a "Start Time" + "End Time" operation, not if "Start Time" and "End
> Time" are Datetime values.
> 
> You can subtract them, "End Time" - "Start Time".
> 
> In VBA, you would do this:
> 
> Public Function ElapsedTimeFromDatetimes(StartDatetime As Date _
>                                        , EndDatetime As Date) As String
> 
>   Dim TotalSeconds As Integer
>   Dim ElapsedHours As Integer
>   Dim ElapsedMinutes As Integer
>   Dim ElapsedSeconds As Integer
> 
>   TotalSeconds = DateDiff("s", StartDatetime, EndDatetime)
> 
>   ElapsedHours = TotalSeconds \ 3600
>   ElapsedMinutes = (TotalSeconds \ 60) Mod 60
>   ElapsedSeconds = TotalSeconds Mod 60
> 
>   ElapsedTime = Format(CStr(ElapsedHours), "00") & ":" & _
>                 Format(CStr(ElapsedMinutes), "00") & ":" & _
>                 Format(CStr(ElapsedSeconds), "00")
> 
>   ElapsedTimeFromDatetimes = ElapsedTime
> 
> End Function
> 
> The function call would appear as:
> 
> ElapsedTimeFromDatetimes([StartDatetime], [EndDatetime])
> 
> 
> In a single expression, you would use:
> 
> Format(DateDiff("s", [StartDatetime], [EndDatetime]) \ 3600, "00") & ":" &
> Format(DateDiff("s", [StartDatetime], [EndDatetime]) \ 60 MOD 60, "00") & ":" &
> Format(DateDiff("s", StartDatetime], [EndDatetime]) MOD 60, "00")
> 
> 
> Sincerely,
> 
> Chris O.

I do something similar here:

http://groups.google.com/group/microsoft.public.access/browse_frm/thread/be7e101c5176ebd8

James A. Fortune
MPAPoster@FortuneJames.com
0
James
7/29/2007 2:32:57 AM
In article <A427AF17-A90A-4F15-8F6F-0CF12FD5614F@microsoft.com>, 
pauld@discussions.microsoft.com says...
> Tom,
> 
> I need to calculate elapsed time in hours:minutes:seconds to score a race 
> that usually exceeds 23:59:59.
> 
> Is there a way to calculate this in Access ? It's simple in Excel by setting 
> the time format to 37:50:55 and all values over 23:59:59 calculate properly.
> 
> I know nothing about Visual Basic and hope there is a way to handle this 
> with using my knowledge of Access. I want to use Access to do this since the 
> other important information about the race is in Access. We've figured out 
> how to do everything else, but this one baffles us.
> 
> "Tom Wickerath" wrote:
> 
> > Hi Craig,
> > 
> > Here are some articles that you may find helpful:
> > 
> >    On time and how much has elapsed
> >    http://office.microsoft.com/en-us/access/HA011102181033.aspx
> > 
> >    Using dates and times in Access
> >    http://office.microsoft.com/en-us/access/HA010546621033.aspx
> > 
> >    ACC2000: How to Calculate Daily Hours Based on Clock In/Clock Out Times
> >    http://support.microsoft.com/?id=237958
> >  
> > Note: Disregard the "ACC2000:" in the title of the third article. It should 
> > apply equally well to other versions of Access.
> > 
> > 
> > Tom Wickerath
> > Microsoft Access MVP
> > https://mvp.support.microsoft.com/profile/Tom
> > http://www.access.qbuilt.com/html/expert_contributors.html
> > __________________________________________
> > 
> > "Craig G." wrote:
> > 
> > > I am trying to calculate "Start time" + "End Time" on a form in ACCESS 2007 
> > > 
> > > example: I started @ 3:00 am on tuesday and did not finishish until 5:00 pm 
> > > on saturday.
> > > How do I make a calculaution to give me a total for this?
> > > 
> > > what fields should be included in the datasheet and the form?
> 

in a query:
Right("0"+CStr(DateDiff("s",a.start_date,NZ(a.finish_date,a.start_date))
\3600),2)+":"
+Right("0" & CStr(DateDiff("s",a.start_date,NZ(a.finish_date,a.start_date)) Mod 
3600)\60,2)+":"
+Right("0"+CStr((DateDiff("s",a.start_date,NZ(a.finish_date,a.start_date)) Mod 
3600) Mod 60),2) AS [Elapsed Time]
0
Michael
7/29/2007 12:29:42 PM
Did you take a look at the first article that I included the link for? The 
HoursAndMinutes function does just what you are asking.


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

"pauld" wrote:

> Tom,
> 
> I need to calculate elapsed time in hours:minutes:seconds to score a race 
> that usually exceeds 23:59:59.
> 
> Is there a way to calculate this in Access ? It's simple in Excel by setting 
> the time format to 37:50:55 and all values over 23:59:59 calculate properly.
> 
> I know nothing about Visual Basic and hope there is a way to handle this 
> with using my knowledge of Access. I want to use Access to do this since the 
> other important information about the race is in Access. We've figured out 
> how to do everything else, but this one baffles us.
> 
> "Tom Wickerath" wrote:
> 
> > Hi Craig,
> > 
> > Here are some articles that you may find helpful:
> > 
> >    On time and how much has elapsed
> >    http://office.microsoft.com/en-us/access/HA011102181033.aspx
> > 
> >    Using dates and times in Access
> >    http://office.microsoft.com/en-us/access/HA010546621033.aspx
> > 
> >    ACC2000: How to Calculate Daily Hours Based on Clock In/Clock Out Times
> >    http://support.microsoft.com/?id=237958
> >  
> > Note: Disregard the "ACC2000:" in the title of the third article. It should 
> > apply equally well to other versions of Access.
> > 
> > 
> > Tom Wickerath
> > Microsoft Access MVP
> > https://mvp.support.microsoft.com/profile/Tom
> > http://www.access.qbuilt.com/html/expert_contributors.html
> > __________________________________________
> > 
> > "Craig G." wrote:
> > 
> > > I am trying to calculate "Start time" + "End Time" on a form in ACCESS 2007 
> > > 
> > > example: I started @ 3:00 am on tuesday and did not finishish until 5:00 pm 
> > > on saturday.
> > > How do I make a calculaution to give me a total for this?
> > > 
> > > what fields should be included in the datasheet and the form?
0
Utf
7/29/2007 6:36:02 PM
Reply:

Similar Artilces:

Calculated Fields in SmartList Builder
Calculated fields within a calculated field can be used?. Of being thus How I make to do a calculated field that I added that calculated field plus another field of a table? You cannot make use of a previously defined calculated field for a subsequent calculated field. You will have to repeat the entire formula. The other option would be to create a view within SQL on which the SLB Object is based which includes your first calculated field. Then in SLB make you next calculated field. Robert Alejandro Luft wrote: > Calculated fields within a calculated field can be used?. > Of be...

enter time into file for a time sheet
how can I enter the time automatically into a cell. perhaps a macro. hilte the cell and hit your macro or enter? I want to round the time to the nearest 1/4 hour. I also want to be able to override the automatic function The quick way to enter current time is Ctrl plus the colon (date is Ctrl plus semi-colon) but this doesn't round to the nearest 15 minutes. I think there is an add-in that would do that as a worksheet function. Here is a subroutine that might do what you want: Sub RndToQtrHr() Dim currMin As Long Dim M As Long Dim plusHour As Boolean currMin = Minute(Time) plusHour = ...

VBA: Like to get MP3 Playing Time
So far, I get get filesize and number of MP3 in a directory (album) but would like to get the playing time. Would also would to get ID3v2 tag info: year and brate. Thanks very much. -- Butch Meese Butch, Check out http://www.dv.co.yu/mpgscript/mpeghdr.htm#MPEGTAG -- Earl Kiosterud mvpearl omitthisword at verizon period net ------------------------------------------- "Butch & Mary Ann Meese" <butchmeese@comcast.net> wrote in message news:z62dnTWl3bqy8TGiRVn-sg@giganews.com... > So far, I get get filesize and number of MP3 in a directory (album) > but would l...

Open two episodes or two money files at the same time
Hello, I am using MS Money 2007 standard on XPSP2. Is it possible to open two episodes or two money files at the same time? I cannot seem to find a way to do so. -- Thanks, Bob In microsoft.public.money, BBran wrote: >Hello, > >I am using MS Money 2007 standard on XPSP2. > >Is it possible to open two episodes or two money files at the same time? I >cannot seem to find a way to do so. No. Instead open one on your nearby laptop and one on the desktop. Or print information from one file to compare to the information on the other file. CutePDF or PDF995 can be useful...

Form Calculations
Is it possible to have a calculation in a form field to add two numbers together and then dump in the table? ...

Excel should format time down to the hundredth/sec.
I would like to be able to format the cells within Excel so that if I typed in my athlete's time from a race as 153268 or 3245, it would show up in the cell as 15:32.68 or :32.45 respectively. I would also like to be able to then add or subtract time in that same format. Right now I can only format the cell to display those times as 15:32.6 or 00:00.0 (nothing at all). I do race time analysis with excel but I have to convert the time into all seconds if I want to add/subtract/divide or whatever. Can you add a format that would recognize time not in the sense of how a clock on th...

Pivot Table question: Creating a new field that calculates the division of one data field by another
I have a pivot table that includes the sum of sales (a data field) and the count of sales (a data field) by product. It looks like this. sum of sales Count of units Product a 100 8 product b 45 6 Etc. I am trying to create another field that divides the sum of sales by the count of units for each product (i.e. in a fourth column. Is there an easy way to do this (within the pivot table). I tried using the calculated field option, but didn't seem to find the way to do it. Also once I have created a c...

calculate total occurrence of a keyword(s)
This is for a survey comments exported to Excel. I'd like to tally the total occurrence of certain keywords in cells. sumproduct come into mind but it capture the total of an exact entry. Is there a way I can add up all the cells that contain a or multiple keywords I indicate. TIA Some examples would help best wishes -- Bernard Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme "cpliu" <spamfreeliu@yahoo.com> wrote in message news:0c029cb8-29c7-41ce-8741-fa07a1146d1d@b1g2000hsg.googlegroups.com... > This is for a survey comments exported to Excel. I'd li...

how to calculate the difference of values (numbers) in a column?
A B C D A1 10 A2 9 1 A3 8 2 1 A4 7 3 2 A5 6 4 3 1 I need to calculate the differences of each value in a column and have the answers on second third column. For example subtract A2 from A1, A3 from A1, A4 from A1, A5 from A1; and subtract A3 from A2, A4 from A2, A5 from A2; subtract A4 from A3, A5 from A4; and finally subtract A5 from A4. Any help is appreciated. Hi, try this select B2:B5 and enter this formula in B2 =$A$1-(A2:A5), confirm with Ctrl-Shift-Enter. similarly for C3:C5 =$A$2-(A3:A5) D4:D5 =A3-(A4:A5) hth...

Increase time allowed for services to start?
How does Windows XP decide all services have started and that it's okay to allow someone to log in? I would like to make it wait a longer time since some impatient users are logging in too quickly and complaining when tray icons (for example safe removal, volume control) never appear. -- Brian Gregory. (In the UK) ng@bgdsv.co.uk To email me remove the letter vee. On Sun, 28 Feb 2010 23:53:04 -0000, "Brian Gregory [UK]" <ng@bgdsv.co.uk> wrote: >How does Windows XP decide all services have started and that it's okay to >allow someone t...

formula for start
I am designing a spread sheet for staff payroll. Enter start time and finsh time, if total is greater than 8 hours hours paid will deduct half an hour off for unpaid break. New to formulas and i can't get this one sorted apreciate any help Assuming start time is in cell A3, finish time is in cell B3, in cell C put this formula =IF((B3-A3)>TIME(8,0,0),(B3-A3)-TIME(0,30,0),B3-A3) Format all cells as Time > 13:30 and enter all times using the 2 hour format where 18:00 = 6:00 p.m. (this eliminates the need fo entering A.M. or P.M. for each entry) ht -- swatsp0 ---------...

Showing Appointment times
Outlook 2003 SP2 XP2 / SP2 A user enters appointments into the calendar. In DAY view, some of the completed entries show the time of the appointment and others do not - these items were entered one right after the other on the same day, and on the same day of the month (one at 8:00 am the other at 2:30 pm). (In month and week view, the appointment time displays on all entries.) Can you shed any light on how/why this might happen and how we can fix it? Thanks MUCH in advance!!! C.H. *tap* *tap* *tap* - Is this thing on? Can anyone help me with my question? ...

Checking time and inserting a value in a different cell
I have Column H that has been formatted as time (i.e. 1:30 PM). If the value in column H is Less than 07:30 and Greater than 15:30, I would like the number 41079 populated in the appropriate cell in column J. If the test is not False, I would like the value 41078 populated. I have inserted the following formula in H6 ‘=IF(H6>15:30 and <7:30,41078,41079)’, however when I depress the enter key J6 displays #NAME. Can you help? Thanks Pank Hi Pank, I think the easiest thing to do would be to put your low (07:30) and high (15:30) times in a couple of cells somewhere and then refe...

Report Calculations
I posted a question a couple of days ago and have not yet received any answers. Therefore, I'm wondering now if anyone knows of a good place to go to get the answers I'm seeking regarding what's probably a complicated calculation in a report (concerning calculations when working with grouped data). I'm not even sure if what I'm wanting to do can be done. Thank you. On Thu, 7 Feb 2008 09:22:04 -0800, Jen wrote: > I posted a question a couple of days ago and have not yet received any > answers. Therefore, I'm wondering now if anyone knows of a good place t...

Combo Box
Hi All, I created a combo box that is linked to a set of cells that contain numbers but for which I have selected to format as time i.e. the cells look like this: 12:00 AM 12:30 AM 1:00 AM 1:30 AM 2:00 AM 2:30 AM My problem is that when I select a value with the combo box, it displays them as the number, not as a formatted time and I cannot see which property to edit on the combo box to have the output formatted as time. Any help would be most appreciated! Rob :) How about removing that link to the range and just add the values to the combobox. dim myCell as range dim myRng as range ...

Creating a Combined Date/Time Shortcut
I know Excel provides shortcuts for entering the date (CTRL + ;) and the = time (CTRL + SHIFT + ;), but I really need one that will enter both the = date=20 and time in the same cell at the same time. (Since Excel does provide=20 formatting for same-cell date and time, it seems kind of odd that there = isn't=20 a shortcut to facilitate entry.) Is it possible to create an entirely = new shortcut=20 that doesn't use macros? (This last point is important, since the = workbook is=20 shared on a network.) Any help anyone can offer would be much appreciated--I'm getting=20 desperate. T...

Is microsoft having a lottery in the united kingdom at this time,
Is microsoft having a lottery winning notification at this time and are they charging a fee for the delivery and insurance for the winning prize. 1. Wrong newsgroup, but I don't think there is a group for Microsoft scams. 2. You already know the answer to this question, don't you? If not, you really shouldn't have a computer with Internet access. -- JoAnn Paules MVP Microsoft [Publisher] "lonerider01" <lonerider01@discussions.microsoft.com> wrote in message news:11E06343-7B33-44F7-BE9A-C110CC30BD01@microsoft.com... > Is microsoft having a lottery winn...

One-Time Multiple Mailing Issue
In Outlook 2007 I would like to mass mail about twenty recipients but do not need to maintain contacts. How can I configure this so that each recieves an email with their email address only. You can put all the addresses in the BCC field then. Depending on where you have written down the addresses, you can also use a mail merge or reply via a rule. For details see; http://www.howto-outlook.com/howto/mailmerge.htm and http://www.howto-outlook.com/howto/messagetemplates.htm#rules -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.ho...

Converting time into another time zone
I was helped here once before. I'm given reports but they are in a different time zone. I need to make that data work for me with what time it would be in my time. I was given the following string. =B2+C2-TIME(6,0,0) B2 is the time & C2 is the date. My output string is the East Coast Time below. Time Date East Coast Time 22:44:18 1/12/2009 Monday 1/12/09 16:44:18 Works like a charm. Issue now is that I'm taking 24h time from one time zone and converting it to 24h time in my time zone. I'd prefer that my time zone be put into...

Move emails to a folder rule (Time based)
Hi. I have a rule that moves some emails to a folder based on the senders email. I would like to have outlook move all emails form the folder to a second one that are older than seven days. Any ideas? Thanks. PS, how do you create a custom rule? Rules act on messages when they are received in the in-box or sent. Outlook has no way of going back to move items after they have been received. You could probably write a little VBA routine to do what you want - see http://www.outlookcode.com for some samples or repost in an Outlook programming group for some potential help. --...

data pulling multiple times
I have a query that is setup to pull data from a form. When I run the query it is pulling quadruple the data required. I have tried everything to troubleshoot this with no luck. If I have a relationship setup and I create the same relationship in my query will that cause the query to pull duplicated data? Please help... Thanks This may seem picayune, but I think it helps to have a clear picture ... Unless your query is using selection criteria that is entered on a form, your query will be pulling data from one/more underlying tables, not from forms. And if you have a p...

Timer causes run-time error '6' overflow
I'm using Timer to profile some code. For no reason I can think of I'm getting overflow when trying to call Timer to get the time value. Why would this happen? If I enter debug mode and press continue, the error goes away. Thanks, Brian Brian, Post your code? Bernie MS Excel MVP "Brian Murphy" <bmurphy@xlrotor.com> wrote in message news:b24bcd5b-2537-4572-a372-5c05df6bf229@k4g2000yqb.googlegroups.com... > I'm using Timer to profile some code. For no reason I can think of > I'm getting overflow when trying to call Timer to get t...

Times New Roman Bold in Word for Windows not showing up correctly in Word for Mac
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I created a Word document in Word 2007 on Windows XP. The document has certain text formatted as &quot;Times New Roman&quot; with bold (I'll refer to this text as the &quot;Test Text&quot;). The font dialog box shows the font type for the Test Text as &quot;Times New Roman&quot; and the &quot;bold&quot; option is selected. <br><br>I emailed that document to my Mac OS X and opened it with Word 2008 on my Mac. The document formatting for the document as a whole look...

date Calculation #5
-- Nisha P ...

HELP
Can someone help me figure out why this is happening please? I'm getting an error: Syntax error (missing operator) in query expression 'TitleID=43AND strPassword="GA3' in the following code: Private Sub txtTitleRP1Password_AfterUpdate() Dim rst As DAO.Recordset If Trim(Me.txtTitleRP1Password & "") = "" Then Me.txtTitleRP1 = "" Me.txtTitleRP1.SetFocus Else Set rst = CurrentDb.OpenRecordset( _ "SELECT Title From tblTitle " & _ "WHERE Tit...