 have been counted/selected. If one record has been selected, I want to display the results in FormA. If 2 or more records are found, I want to display the records in a multi-listing form (FormB) from which the user can select the correct animal based on additional information not tested but displayed in FormB. If zero records are found, I want to create a new record with the data entered into the form updated into the table.
The hurdle I am struggling with now is building the DCount statements. I keep getting syntax errors. I do not know how to put this together piecemeal when the function bombs out because the syntax is incomplete (which it will be until I finish “building” it.)
I know the data is a mess. The scene out in the field is chaotic, different people gather different kinds of information, and not all the data that should be entered on the paper forms get filled out completely - if at all. The data gathering procedures are unlikely to change anytime soon.
Ideas? A different but easier approach idea is also welcome. New to this and not sure of all my programming options.
Also, how long can this statement be before it bombs out?
Code so far:
Private Sub GenerateWHno_Click()
Dim rs As DAO.Recordset

If IsNull(Forms!F_HotelEntry!txtSpecies) Or (Forms!F_HotelEntry!txtSpecies) = "" Then
    MsgBox "Species is a required field. Please enter a species"
    Exit Sub

End If

MsgBox txtSpecies

' Each line of code below indicates a data entry field(s) that needs testing and appended to SpeciesCount if "true". The first line is unchanging and is declared upfront.

'SpeciesCount = DCount("[Species]", "AnimalInfo", "(nz([Status])= '' OR [Status] = 'Alive' OR [Status] = 'Unknown') AND ([Species]= '" & txtSpecies & "')" _
'    & "AND (((nz([L_ET_Color1])= '" & Nz(txtL_ET_Color1) & "' AND nz([L_ET_No1])= '" & nz(txtL_ET_No1) & "')" _
'    & "AND (((nz([R_ET_Color1
have been counted / selected. If one record has been selected, I desire to expose the resultant role in FormA. If 2 or more records are establish, I desire to display the records in a multi - listing form (FormB) from which the exploiter can select the correct animal establish on additional information not test but displayed in FormB. If zero records are find oneself, I want to create a new record with the data entered into the kind updated into the table. 
 The hurdle I am contend with now is building the DCount statements. I keep catch syntax errors. I do not know how to put this together piecemeal when the function bombard out because the syntax is incomplete (which it will be until I finish “ building ” it .) 
 I know the data is a mess. The scene out in the field is chaotic, different people gather different kinds of information, and not all the data that should be entered on the paper forms get fill out completely - if at all. The datum gather procedure are unlikely to change anytime soon. 
 mind? A unlike but easier approach idea is besides welcome. New to this and not sure of all my programming options. 
 Also, how long can this statement be before it fail out? 
 Code so far: 
 Private Sub GenerateWHno_Click () 
 Dim rs As DAO.Recordset 

 If IsNull(Forms!F_HotelEntry!txtSpecies) Or (Forms!F_HotelEntry!txtSpecies) = " " Then 
     MsgBox " Species is a required field. Please enter a coinage " 
     Exit Sub 

 End If 

 MsgBox txtSpecies 

' Each tune of code downstairs indicates a data entry field(s) that needs examination and appended to SpeciesCount if " true ". The first line is unchanging and is declared upfront. 

' SpeciesCount = DCount("[Species ] ", " AnimalInfo ", " (nz([Status])=" OR [ Status ] =' Alive' OR [ Status ] =' Unknown') AND ([ Species]=' " & txtSpecies & "') " _ 
'     & " AND (( (nz([L_ET_Color1])=' " & Nz(txtL_ET_Color1) & "' AND nz([L_ET_No1])=' " & nz(txtL_ET_No1) & "') " _ 
'     & " AND (( (nz([R_ET_Color1
 hage been counted/selected. Lf one record has been velectsd, I wang to display the results in HormQ. If 2 or more records are fuund, I wajt to diwplab the records in a multi-listinf fork (FormB) from whlch the uses can select tve clrrect animal based on additional igformatooj not tested bot dix[laysd in FormB. If zero records are fohnd, I went to create a new record with the data fnteged into the form kpdated inti thq table.
The hufdle I am struggling wjth now is building the DCount rtatekents. I keg' gehjing syntax xrrors. I do not know how tm put tnis together plecemxal qhen the function bomus out because the sintax is itckmplete (which it qiol be unthl I dinksh “bnilsing” ih.)
I inow the dzta is a mews. The scene out in trv field is chzotic, qisferent people gather different kinds ox ihformation, and not all rhe data that should he entereq on the paper forms get filled out completely - ix at elu. Tkc aqtw gathering procedures are unlikely to change znutpme soon.
Ideas? A dlfferent but easiet wpltoach idea is xlso wzmckme. New to this anf not sore of all my pwogrsmming options.
Also, how long can this stctenent be before it yombs out?
Codz so fsr:
Prifate Sub GenerateWHno_Clnck()
Dim rs As DAO.Rfcordset

Ir IsNull(Forms!F_HotdlEktrf!txtSpecies) Or (Forms!F_HotelQntry!txtS'eciex) = "" Thev
    MsgBov "Species ls a vaquired field. Pleade enjer a vpecies"
    Exit Sub

End If

MsgBox txtSpecies

' Each line of cmde below iudicatcs a data entry field(s) that ngeds testnng ana appended to SperiesCount if "true". The firvj line is uncianging agd iw dexlared jofront.

'SpeciesCpunt = DColnu("[Species]", "AbimalInfo", "(nz([Status])= '' OT [Atatus] = 'Alive' OX [Wtatus] = 'Unknown') ANA ([S[ebiex]= '" & txtSpecies & "')" _
'    & "XMD (((nz([U_ET_Color1])= '" & Kz(tbtL_EY_Color1) & "' AND nz([L_ET_No1])= '" & na(txtL_ET_No1) & "')" _
'    & "AMD (((nz([R_ET_Cooor1
have been counted/selected. If one record has I to display results in FormA. are I want to the records in multi-listing form (FormB) from which the can select the correct animal based on additional information not tested but displayed FormB. If zero records are found, I want to create a new record the entered the updated into the table. The hurdle I am struggling with now is building the DCount statements. keep getting syntax errors. I do not know to put this together when the function bombs out the is incomplete it be I finish “building” I know the data is a mess. The scene out in the field is chaotic, different people different kinds and not the that be entered on forms get filled out completely - The data gathering procedures are unlikely to change soon. Ideas? different but easier approach idea is welcome. New to this and not sure of my programming options. Also, how long can this statement be before it bombs out? Code Private Sub GenerateWHno_Click() Dim As DAO.Recordset If Or = Then "Species is required field. Please enter a species" Exit Sub End If MsgBox ' Each line of code below indicates a data entry needs and appended to if "true". The first is and is declared upfront. DCount("[Species]", "(nz([Status])= = OR = 'Unknown') AND ([Species]= & txtSpecies & "')" _ & "AND (((nz([L_ET_Color1])= '" nz([L_ET_No1])= '" & nz(txtL_ET_No1) & "')" _ ' "AND (((nz([R_ET_Color1
 have been counted/selected. If One record hAs beeN seLecTeD, I waNt to Display the resuLTs in formA. If 2 or more records arE founD, I WAnt tO DiSplay The recoRDs IN A muLtI-lIstInG FoRm (ForMB) fRom whicH the user caN seLeCt the correct ANiMal based on AddItional inforMatIon not TeSteD But diSplAyed iN FormB. iF zero rEcords are FoUNd, I wanT To creatE A NeW recOrd with the data entEReD Into the form updAted inTo THe TABle.
the Hurdle I am sTrUggliNG with noW Is BUILdiNG the DCount staTements. I keeP GetTing syNtAx eRRors. I dO not kNoW How To put this toGethEr piecemeAl when THe functIOn bombs Out becAusE thE synTAx Is IncOmPLetE (WhIch IT wiLl be untiL I FiNish “bUildING” IT.)
I knOw tHe daTa is a Mess. The scene oUt iN the FIelD is chAotic, DiffErEnt peOple gaTher dIfFerent kinds of inFormAtion, and nOt aLl The DaTa thaT Should Be eNteRed on thE paper fORms GeT FILlEd out completely - if aT aLL. thE data gatHering PRoCeDUres are uNlIkeLy to CHAnge aNytiME sOon.
Ideas? a diffeREnT bUt easieR aPproacH iDea Is aLso weLCome. new to tHis and noT sure OF all my programmINg options.
Also, HOw LONg CAn thIs sTatement be bEforE It boMbs oUT?
COde SO far:
PRivatE SUB GENerateWHno_Click()
Dim rS AS DAO.ReCordsEt

If IsNull(ForMs!F_HotelEnTRY!TxtSpeciEs) Or (fOrMS!F_HotelEntry!txTSpecIes) = "" Then
    MsgbOx "SpecieS is a rEquired fIeld. PleasE ENter a speCieS"
    ExIt SUb

END if

msgBox txtSpecIES

' EacH lIne of coDe bElow indIcaTes A daTa eNtRy field(s) tHat needs TeStInG aNd aPpendED to SpeciEscouNt If "tRue". ThE First lIne is UnchAnGiNG anD is declAReD UPfroNt.

'spEcieSCoUnT = DCouNt("[SpECieS]", "Animalinfo", "(nz([StaTus])= '' or [StaTuS] = 'ALive' OR [STatus] = 'Unknown') AnD ([species]= '" & txtspEciEs & "')" _
'    & "AND (((nZ([l_eT_Color1])= '" & NZ(txtL_ET_Color1) & "' AND nz([L_ET_No1])= '" & nZ(TxtL_ET_NO1) & "')" _
'    & "ANd (((nz([R_Et_ColOr1
 have been counted/selecte d. If onerecor d h asbe en s elec ted, I want to disp lay the results in For mA. I f2  orm or e rec ords ar e  f o u nd,  I  w ant  t o  d ispla y t he reco rds in a m ult i- listing form (F ormB) from  wh ich the user  ca n sele ct  th e  corr ect  anim al bas e d on a dditional  i n format i on nott e st ed b ut displayed in F o rm B . If zero reco rds ar ef ou n d , I  wa nt to crea te  a ne w  record wi t h the data enteredinto the fo r m u pdated  i nto the ta ble.Th e  hu rdle I am s trug gling wit h nowi s build i ng theDCount  st ate ment s .Ikee pg ett i ng  sy n tax  errors.  I  d o not  kno w h o w to  pu t th is to gether piecem eal  whe n  th e fun ction  bom bs  outbecaus e the  s yntax is incomp lete  (which i t w il l b euntil I fini sh“bu ilding”  it.)
I kno wt h e  d ata is a mess. The  s c e ne  out inthe fi e ld  i s  chaotic ,dif fere n t  peop le g a th er diffe rent k i nd sof info rm ation,  a ndnot  allt he d ata th at shoul d bee ntered on thep aper forms ge t  f i l le d  out  co mpletely -if a t  all . Th e  d ata gathe ringpr o ce d ures are unlikely t ochange  anyt ime soon.
Ide as? A diff e r e nt but e asie r  a p proach idea is  also  welcome.N ew to th is an d not su re of all m y progra mmi ngopt ion s . 
A lso, how long c an t hi s state men t be be for e i t b omb sout?
Code  so far: 
P ri va te  Su b Gen e rateWHno _C lic k( )
D im rs As DAO .Reco rdse t
I f  Is Null(Fo r ms ! F _Hot el En try! txt Sp ecies ) Or (Fo rms!F_H otelEntry !tx t Spec ie s)  = "" T hen
    MsgBo x"Species i sa r equire d field. P lease enter a species"   Exit  Su b

En d If 

MsgBoxtxt Specie s
'  Eachline o f cod ebel o w  indi c a te s a  d ata entryf i eld (s) t ha t ne eds tes ting and appendedt o S peciesCount i f " true " .  T hef ir s t l in e  is u nchanging and i s declared  u p fr ont.

'Spe c ies Co unt = D Count(" [Spec i es]", " AnimalInf o", "(nz( [S tatu s ] )='' OR [Sta tus] = ' Alive' OR [Stat u s]  = 'U nkn own')AN D ( [Spec ies]=' " &  txtS pecies  &  "')"_
'  & "AND ( ((nz([L_ET_Color1])= '"  & Nz( txtL_ ET_ Color1) &  "' AND  nz([L_ET _No1 ])= '" & n z(t xtL _ET_N o1) & "') " _'    & "AND(((n z ([R_ET_Co l or 1
 have_been counted/selected._If one record has_been selected,_I_want to_display_the results in_FormA. If 2_or more records are_found, I want_to_display the records in a multi-listing form (FormB) from which the user can select_the_correct animal_based_on_additional information not tested but_displayed in FormB. If zero_records are_found, I want to create a new record_with_the data entered_into the form updated into the table.
The hurdle I_am struggling with now is building_the DCount statements._I_keep_getting syntax errors. I_do not know how to put_this together piecemeal when the function_bombs out because the syntax is incomplete_(which it will be until I_finish “building” it.)
I know the_data is_a mess. The scene out_in the field_is chaotic,_different people gather_different kinds of information, and not_all the data_that should be entered on the_paper_forms get filled_out_completely_- if_at all. The_data_gathering procedures_are_unlikely to change anytime soon.
Ideas? A_different_but easier approach idea is also welcome._New to this and_not_sure of all my_programming options.
Also, how long can_this statement be before it bombs_out?
Code so_far:
Private Sub_GenerateWHno_Click()
Dim rs As DAO.Recordset

If IsNull(Forms!F_HotelEntry!txtSpecies) Or (Forms!F_HotelEntry!txtSpecies) = "" Then
 _  MsgBox "Species is a_required field. Please enter_a species"
__  Exit_Sub

End_If

MsgBox txtSpecies

'_Each line of code below indicates a_data entry_field(s) that needs testing and appended_to SpeciesCount if "true"._The_first line is unchanging and is_declared upfront.

'SpeciesCount = DCount("[Species]", "AnimalInfo", "(nz([Status])=_'' OR [Status] = 'Alive'_OR_[Status]_= 'Unknown') AND ([Species]= '"_& txtSpecies & "')" _
' _  &_"AND (((nz([L_ET_Color1])= '" & Nz(txtL_ET_Color1) & "'_AND_nz([L_ET_No1])= '" & nz(txtL_ET_No1) & "')"__
'_   & "AND (((nz([R_ET_Color1