UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> If "norecordsintablefield" = "value/string" Then    
 
   
XyloseLabs
post Dec 3 2019, 09:15 AM
Post#1



Posts: 13
Joined: 20-November 19



Morning/Evening,

Pardon my pseudo-code:

I'm trying to build a script that, and I'm probably over thinking this, would equate to this:

If "No Records In Table Field" = "Value/String" Then

Me.sfrmSubReport.SourceObject = "Report.rptReport"

End If

My hang up is on the "No Records In Table Field" section, I cant seem to figure out what to put there.

Here is how it all fits in:

CODE
With rs
   For i = 0 To rs.RecordCount - 1
      If rs.Fields("PropertyType_AT") = "Automation" Then
         Me.sfrmLabelView.SourceObject = "Report.rptAutomationLabelTemplate"
      Else
         rs.MoveNext
         If "No Records In Table Field" = "Value/String" Then
            Me.sfrmLableView.SourceObject = "Report.rptNoLablesExist"
         End If
      End If
   Next i
End With


Any guidance would be appreciated!

V/r,

Joe
Go to the top of the page
 
projecttoday
post Dec 3 2019, 09:23 AM
Post#2


UtterAccess VIP
Posts: 11,283
Joined: 10-February 04
From: South Charleston, WV


"No Records In Table Field" = "Value/String"

It is impossible for this to be true.

--------------------
Robert Crouser
Go to the top of the page
 
GroverParkGeorge
post Dec 3 2019, 09:30 AM
Post#3


UA Admin
Posts: 36,181
Joined: 20-June 02
From: Newcastle, WA


What would you expect "No Records In Table Field" to mean?

Are you saying that there is a literal string value that says "No Records In Table Field"?

Are you saying that you want to test for records in a table that match a value in a field?

Or something else I'm totally not thinking of?

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
XyloseLabs
post Dec 3 2019, 09:35 AM
Post#4



Posts: 13
Joined: 20-November 19



Basically I want it to scan a field in a table. If no records in that table list "Automation" in the specified field then I want it to open the "Report.rptNoLablesExist"
This post has been edited by XyloseLabs: Dec 3 2019, 09:47 AM
Go to the top of the page
 
PaulBrand
post Dec 3 2019, 10:25 AM
Post#5



Posts: 1,747
Joined: 4-September 02
From: Oxford UK


I think I see. Try using a DCount

CODE
If DCount("[PropertyType_AT]",TableName,"[PropertyType_AT] = Automation") = 0 Then


Untested...
This post has been edited by PaulBrand: Dec 3 2019, 10:26 AM

--------------------
Paul
Go to the top of the page
 
projecttoday
post Dec 3 2019, 10:33 AM
Post#6


UtterAccess VIP
Posts: 11,283
Joined: 10-February 04
From: South Charleston, WV


Use Dlookup instead of Dcount for better performance.

--------------------
Robert Crouser
Go to the top of the page
 
XyloseLabs
post Dec 3 2019, 11:25 AM
Post#7



Posts: 13
Joined: 20-November 19



Came through for me yet again, thanks UA
Go to the top of the page
 
kfield7
post Dec 3 2019, 12:12 PM
Post#8



Posts: 1,024
Joined: 12-November 03
From: Iowa Lot


Would it be an equality or could it contain "automation"?

like "*automation*"

or

instr(1, [ProperType_AT], "automation", 0) > 0
Go to the top of the page
 
XyloseLabs
post Dec 4 2019, 07:41 AM
Post#9



Posts: 13
Joined: 20-November 19



In this case, the particular field in the table is populated via a combo box selection, making the chance of another string/value being entered into the field almost non existent.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    11th December 2019 - 08:31 AM