If Statement In My Query

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have a query that I've designed to open a form and just display one
project's information. The user has a form in which they select the project
from a list box that they want to see and then that selection goes to my
query. If that project has not had any information entered against it I need
the form to start a new record using the project selected in my combo box
that prompts the query in the where clause.

SELECT tblCheckbookLog.Date, tblCheckbookLog.Project,
tblCheckbookLog.TransType, tblCheckbookLog.PRNum, tblCheckbookLog.AY,
tblCheckbookLog.PD, tblCheckbookLog.PV, tblCheckbookLog.RE,
tblCheckbookLog.FV, tblCheckbookLog.Obj, tblCheckbookLog.Description,
tblCheckbookLog.Withdrawl, tblCheckbookLog.Deposit,
tblCheckbookLog.AwaitingSigs, tblCheckbookLog.ToRBMD,
tblCheckbookLog.ToPrimavera, tblCheckbookLog.FinalAmt, tblProjects.Office,
tblCheckbookLog.PersonnelName, tblCheckbookLog.Comments,
tblCheckbookLog.VendorName, tblCheckbookLog.TSSElement,
tblCheckbookLog.Category
FROM tblProjects INNER JOIN tblCheckbookLog ON tblProjects.ProjId =
tblCheckbookLog.Project
WHERE (((tblCheckbookLog.Project)=[Forms]![frmProjSelect]![cboProject]));

Any suggestions? I was thinking an If statement but I have no idea how to
say if no records exist create a new one.
.



Relevant Pages

  • Re: DB Result Wizard Error
    ... Also noted that one folder, which contains no information can't be deleted, ... >> For instance Equipment Serial Number, Equipment Model Number, Cost Accounting ... >> to display the new equipment information. ... >> is in the table was added to the query. ...
    (microsoft.public.frontpage.programming)
  • RE: Just starting to design a form (or is it a query?)
    ... A Form is used to display the data and allow ... A query can be the record source for a form. ... that match an ID in the Assessment table. ... Now, assuming this is the case, what you need is a form with a sub form. ...
    (microsoft.public.access.gettingstarted)
  • Re: database lookup
    ... the query on the subsequent page, and display the "drill down" data. ... The thing with PHP and MySQL is that you need the user to do an action ... I tried to state that I have the database designed and implemented but I ...
    (alt.php)
  • Re: how to show two rows in an unbound continuous form
    ... Thanks a lot for your prompt response.Actually i thought of using crosstab ... I have created a crosstab query on the table i gave you earlier.The first ... have bound the form's controlsource also,of course). ... clue how to display the second row to show another leave period(01-05-2009 to ...
    (microsoft.public.access.formscoding)
  • Re: DB Result Wizard Error
    ... It is the standard message: ... For instance Equipment Serial Number, Equipment Model Number, Cost Accounting ... The actual change made was to the equipment inventory query, ... to display the new equipment information. ...
    (microsoft.public.frontpage.programming)