If statment Help - Simon

30-Nov-06 06:51:37
On my form i have a button that when it gets pressed it adds data to
the subform. the code works fine

I just want a if statment that will stop the code working if data
alredy existes in the subform.

If data exists i want a error message, if ther is no data let the code
run


Im not sure how to code it for it to see if there is data in the
subform


Any help will be great


Simon
reply
 
 

If statment Help - SJ

30-Nov-06 09:58:20
Hopefully you've got a KEY field in the subform,  an identifying field,  a
primary key???

if you have then use code like

if isnull(Subform.Form.Primarykeyfield) then

you have no records

the Subform and Primarykeyfield   need to be changed to be your apps names.
eg,    InvoiceLines.Form.InvoiceNo
reply
 
Function Sequnce Error
promotion
Silverlight    WPF    WCF    WWF    LINQ   
JavaScript    AJAX    ASP.NET    XAML   
C#    VB.NET    VB 6.0    GDI+    IIS    XML   
.NET Generics    Anonymous Methods    Delegate   
Visual Studio .NET    Expression Blend    Virus   
Windows Vista    Windows XP    Windows Update   
Windows 2003 Server    Windows 2008 Server   
SQL Server    Microsoft Excel    Microsoft Word   
SharePoint    BizTalk    Virtual Earth   
.NET Compact Framework    Web Service   

"Everything" RSS / ATOM Feed Parser
How to send and receive messages through message queuing in .Net
How to Read text file as database
SQL Server 2005 Paging Performance Tip
Display code of web page.
Fully Scalable Excel File Importer class for .net using Microsoft Jet driver
Generic Chart Color Manager class that can be used for any charts
Helper class to style the infragistics wingrid
Using Reflection to detemine as Assembly Info in and out.
Helper class to play with Window (Owners and position)
Resolving displayname from the culture using the XmlLanguage and LanguageSpecificStringDictionary class