Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Adding a Condition from Check Box

 
   Database Help (Home) -> MS Access RSS
Next:  Set Based Solution  
Author Message
Bob Vance

External


Since: Mar 25, 2008
Posts: 180



(Msg. 1) Posted: Thu Jan 01, 2009 8:25 pm
Post subject: Adding a Condition from Check Box
Archived from groups: microsoft>public>access (more info?)

Part of my code for Distributing Invoices is to give Invoice numbers, What I
am trying to do is give a zero to a Invoice that check box
[ckHoldingInvoice] = True
-------------------------------------------------
If (SubForm)subAdditionChargeChild (Checkbox)ckHoldingInvoice is True Then
InvoiceNo =0 Else
-----------------------------------------------
Part of my Code below!
Private Sub subSetInvoiceValues()
lngInvoiceNo = DMax("InvoiceNo", "tblInvoice") + 1


If lngIntermediateID > lngItMdt Then
.AddNew

lngInvoiceNo = lngInvoiceNo + 1
lngItMdt = lngIntermediateID

--
Thanks in advance for any help with this......Bob
MS Access 2007 accdb
Windows XP Home Edition Ver 5.1 Service Pack 3

 >> Stay informed about: Adding a Condition from Check Box 
Back to top
Login to vote
Arvin Meyer [MVP]

External


Since: Oct 02, 2008
Posts: 266



(Msg. 2) Posted: Thu Jan 01, 2009 8:25 pm
Post subject: Re: Adding a Condition from Check Box [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Bob Vance" wrote in message

> Part of my code for Distributing Invoices is to give Invoice numbers, What
> I am trying to do is give a zero to a Invoice that check box
> [ckHoldingInvoice] = True
> -------------------------------------------------
> If (SubForm)subAdditionChargeChild (Checkbox)ckHoldingInvoice is True Then
> InvoiceNo =0 Else
> -----------------------------------------------
> Part of my Code below!
> Private Sub subSetInvoiceValues()
> lngInvoiceNo = DMax("InvoiceNo", "tblInvoice") + 1
>
>
> If lngIntermediateID > lngItMdt Then
> .AddNew

AddNew to what? In order to AddNew, you need a recordset to add it to.
Additionally, you need a With/End With construct to use AddNew the way you
show it. Sometimes you need the entire relevant code rather than a tiny
snippet.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

 >> Stay informed about: Adding a Condition from Check Box 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Check all check boxes in a multiple form - Hello everyone, I need help trying to check all check boxes in a continuous form. Now, this form has only filtered data from its table. I need to change all the check boxes to TRUE but only the data reflected on this form, not the whole table. Please..

Access Check-in and Check Out Database ??? - Im creating a check in – check out database for RF guns. I have a table that contains models. ID (primary key) Model A table that contains Gun Details ID (primary key) Model_id Gun_Number (assigned gun number by operations) SerialNum Location (this....

If-else condition - Hi folks, I have a form(frmResultsDisplay) that displays the status of an equipment. Based on the status whether "Pending" or "Approved", i want to restrict the user. What i mean here is if the status is pending, i want to restrict t...

Where Condition - Can some one write me the code in Visual Basic for an expretion similar to the Where Condition to open a report? I can't use the Where Condition because it pop up a message of Microsoft database Jet Engine. Any help I will realy apriciate it. Thanks,....

Records with condition - Hi, I have a form "frmbirthsearch" with 2 unbounded objects for birth dates: txtStartDate and txtEndDate with cmdOK command button. How do I write the event procedure (on click) so as when this OK button is clicked the query qryaddress is ope...
   Database Help (Home) -> MS Access All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]