Search results

  1. G

    Working Dlookup code not working

    Thanks bob that works. But(sorry i just get annoyed when i cant make something work that i have had working before.) The problem is that eventually the DocumentNo will be 5 numbers long and the top 15 in the list will probably be the only ones that are selected so this is why i have the line...
  2. G

    Working Dlookup code not working

    ok i tried the code in the first box, this still gives me the message box "incorrect selection" if i enter one of the numbers in the line column. The second part of code is supposed to find the related record for the documentno of the record that you selected in the first form. i.e type supp2...
  3. G

    Working Dlookup code not working

    Ok bob ive uploaded the db as requested. The problem is with the FrmGRSelect, if you enter s into the first textbox and select a supplier from the list this filters the listbox. Then if you go to the textbox at the bottom of the form and enter a number for a record it should in theory open up...
  4. G

    Working Dlookup code not working

    Ok bob i have tried your ideas and am still having trouble making dlookup work so i assume its the way the database is set out or something so have you any ideas what could be causing this Thanks Gareth
  5. G

    Changing code for text to numbers

    Basically i had this code for a search form by customer accountcode which was text and works perfectly but im am triying to setup a search form by document number which is a number. the part i think may be wrong is this part:- SupSql = "SELECT SupplierID, DocumentNo, DeliveryDate, Reference...
  6. G

    Changing code for text to numbers

    i have the following code in the afterupdate event of a combo box which is used to filter some records in a table depending on the item selected in the combo box:- Dim SupSql As String Dim sSupp As String sSupp = Trim(Me.TxtSupplier.Text) If Not sSupp = "" And isdelorback = False Then SupSql...
  7. G

    Working Dlookup code not working

    Thanks bob that works a treat. Its still bugging me that i can get it to work on one form but not another, I also have the second part of the code(finding a record) in the on open event of the form(FrmGR) and that doesnt work either. I,m thinking maybe there is a bit of corruption going on or...
  8. G

    Working Dlookup code not working

    Hope someone can help with this very strange but seriously annoying problem. I have a form with an unbound text box(TxtPONo) that has a number entered into it and if it matches a number in my table(TblTransactions) then it should open a form(FrmGR). Seems simple enough and here is the code i am...
  9. G

    Dlookup with where clause

    I do want this to be independent of any particular form. Any pointers on the parameters part as im in unchartered waters with that. Thanks Gareth
  10. G

    Dlookup with where clause

    ok i think im getting you now. The items that you have marked are fields in a table that will also be bound to different forms. This is why i wanted a function so it pulls the correct vat value dependent on the date of the original document. As for the value of the function, the vat value...
  11. G

    Dlookup with where clause

    Ok i thought i understood the first part of your answer and changed it to the following: Public Function GetVatValue() Dim VatAmount As Double VatAmount = Nz(DLookup("VatRate", "TblVat", "DateFrom>= #" & TaxDate & "# AND DateTo <= #" & TaxDate & "# And DocumentNo = " & DocumentNo), 0) End...
  12. G

    Dlookup with where clause

    Basically what i want is for this too be a function so when it is called by numerous forms it will call the correct VatValue. I have had a go but cant get it to work correctly here is what i have so far Public Function GetVatValue() Dim VatAmount As Double VatAmount = Nz(DLookup("VatRate"...
  13. G

    Dlookup with where clause

    Thanks for the help Pbaldy the code was fine just needed a bit of fiddling with the way i had set it up on the form to get it to work. Now i dont know if i should start a new post or carry this one on so here goes with the second part to my question. I want to create a function with this so im...
  14. G

    Dlookup with where clause

    still having trouble getting this to work. At the moment i am using the following code Private Sub TxtSubTotal_AfterUpdate() Dim vattotal As Integer Dim Vatsum As Integer vattotal = DLookup("VatRate", "TblVat", "DateFrom>= " & Forms!FrmInvoiceHeader!TaxDate & " AND DateTo <= '" &...
  15. G

    Dlookup with where clause

    Thanks Paul I had a look at this before and that is what has me confused as i want something like the following: =Dlookup ("Vatrate","TblVat", where forms!FrmParent!Taxdate is inbetween the date from and date to in TblVat
  16. G

    Dlookup with where clause

    i hope this is in the right forum. I have a subform with a textbox that is used for VAT(TxtVAT) and another textbox with a subtotal(TxtSubtotal). I have a table with the different VAT rates and the dates From and To. What i would like is on the OnChange event of the TxtSubtotal box i want to...
  17. G

    minus discount on invoice

    thanks for the replies = [txtretail] * [Movement] * (1 - [discount]) works like a charm
  18. G

    minus discount on invoice

    here is the exact code i used in the txtlinetotal textboxes control source = [txtretail] * [Movement] * (1 - [discount]/100) AND = (1-([discount]/100)) * ([Movement] * [txtRetail]) I had to change the name of quantity to movement as this is the name of my textbox and table field, i just used...
  19. G

    minus discount on invoice

    Thanks for the quick replies steve and bob I tried both options and now its getting stranger as it just takes £0.01 of the total giving me the value £23.99.
  20. G

    minus discount on invoice

    What should have been a simple task is now a pain in the rear end. I have an invoice form(InvoiceHeader) with a continuous subform(InvoiceSub) to enter goods into which works great. After i enter a product the retail price is automatically filled in TxtRetailPrice and then i enter a quantity...
Back
Top Bottom