I am making a simple payroll program that keeps track of my hours, jobs, descriptions, etc. It also keeps track of the checks I've gotten. I have three main tables: Hours consisting of date, time started, ended, total hours, customer, job, description, Payperiod number, I know this one could be broken down more but that's not what I'm after right now. The other two are two are Checks and PayPeriod each with a matching index for joining. That part works fine. I'm using Flexgrids for my output. I would like to use a combo box so I can look at individual pay periods(1,2,3, Pay Period Index). After alot of frustration, I finally got what I thought would work but it now tells me Microsoft Jet Engine can't find table check spelling or existence done both don't know why anymore. Here's part of whats written the reason I didn't use * was because I didn't want to show period or index columns

If cboViews.Text = "By Period" Then
  If cboPeriod.Text <> "" Then
   QueryOne = " Select Hours.date,Hours.[time started],hours.[time ended],hours.[hours  _ worked],hours.customer,hours.description From Hours where hours.period = '" &  _ cboPeriod.Text & "' Order by hours.date desc, hours.[time started] asc"
   datHours.RecordSource = Chr(34) & QueryOne & Chr(34)
   datHours.Refresh
   flxHours.Refresh
  Else
   ErrMess = "Please select a period"
   MsgBox ErrMess
  End If
End If

Please Help with as little laughter as possible I did not go to school for this nor am I it is for broadening my horizons and learning I've been reading books and trying to figure it out but as of yet I have not.

Thanks,

Bakedsushi

First of all you should not have any spaces in your column headings in the database, change
time started to time_started in your database etc

Second, in your query you are only selecting from hours table so you don't need to say
select hours.date
but only select date etc from hours

there is simple syntax error in ur code. use the following :-
QueryOne = "Select date,time_started,time_ ended,hours_worked,customer,description From Hours where period='" & _ cboPeriod.Text & "' Order by date desc, time _started asc"
datHours.RecordSource = trim(QueryOne)

**replace all of ur fields that have
space with underscore.**

Okay, I tried that now I get another error too few parameters expected 3

Okay, I tried that now I get another error too few parameters expected 3

that because of you are calling more fields in query rather than what is restricted.
use '* from' in your query to fetch all fields from the table. then display value of only those fields which you are wanting.

Regards
Shouvik

This article has been dead for over six months. Start a new discussion instead.