Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using IF statement!!

Status
Not open for further replies.

realstandman

IS-IT--Management
Oct 29, 2003
87
US
I am trying to use an if statment on in my module where if a table has a field with a value of 1 then do the statement if else continue. This is the code I have so far. Can someone point me in the right direction as to how to get this working. Everything works but the if. I have other code before and after this and am just trying to get this code skipped if [dbo_GroupsFutureHealthDM.SendHistoryFlag] = "1"

If [dbo_GroupsFutureHealthDM.SendHistoryFlag] = "1" Then
Me.lblStatus.Caption = "Building History med claims data..."
DoEvents
DoCmd.TransferDatabase acExport, "dbase IV", sfolder, acQuery, "qryMedClaimsHistory", sfile, False, False
snewfile = sfolder + "FutureHealth_MedClaimsHistory_" & Format(Now(), "yyyymmdd") & ".dbf"
fso.CopyFile sfolder + sfile, snewfile, True
Kill (sfolder + sfile)
End If

Don't think and the solution will come.
 
What is [dbo_GroupsFutureHealthDM.SendHistoryFlag] ? I assume that there is a form called "dbo_GroupsFutureHealthDM" and a control or field called "SendHistoryFlag". I also assume that this is not on the current form.

if forms("dbo_GroupsFutureHealthDM").controls("SendHistoryFlag")

or in Bang
forms![dbo_GroupsFutureHealthDM]![SendHistoryFlag]

or if on the current form

me.SendHistoryFlag

Also is 1 a string or not. If it is not a string then just 1 without the quotes.
 
If [dbo_GroupsFutureHealthDM.SendHistoryFlag] is numeric:
[tt]If [dbo_GroupsFutureHealthDM.SendHistoryFlag] = 1[/tt]
If it is boolean, = True or = False, depending on which you want.
 
Got it. It was boolean.

Thanks,

Don't think and the solution will come.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top