Search results

  1. A

    INSERT statement

    Ive got the following INSERT statement Dim SQL As String Private Sub Save_Click() [Forms]![Entry settings]![PSM Code] = [Forms]![New Part settings]![PSMCode] [Forms]![Entry settings]![PSM Code].SetFocus SQL = "INSERT INTO Part(PSM Code, Part Prefix, Part Base, Part Suffix, Part Description...
  2. A

    User rights

    Has anyone got an idea on how to issue user rights i.e. one person can write to a certain table whilst another can only read the same table. Ive had a good search but unable to find anything! If anyone has a good thread or website I would be most grateful!
  3. A

    Inserting new values into a combo box

    Rural guy Ive took note of the database that UncleGizmo posted on his website and typed the following SELECT [Press Line Table].[Press Line] FROM [Press Line Table] UNION SELECt "*","<ALL>" FROM Press Line Table; but I get an error saying Syntax error in FROM clause I then tried to type...
  4. A

    'Greying-out' a field etc.

    Conditional formatting Yes there is a way. If you have a check box (which I will call checkbox1), then in the afterupdate() event type the following; If checkbox = True Then ' This will allow the user to enter information Me.textarea.enabled = true Me.textarea.backcolor =...
  5. A

    Inserting new values into a combo box

    Hi, I have a form which has a combo box on it whose rowsource is a table i.e. the source code of the combo box is SELECT [LineTable].[Line number] FROM LineTable This will give me all values already stored in the Line Table. However because I want to produce a query from the value stored here...
  6. A

    Form criteria using a list box

    Thanks for your replys. Ive already tried using the last code myself and when I do it I have an error saying invlaid use of brackets where the tables and attributes are declared i.e. [tblSettings.Part_number]. Any suggestions?
  7. A

    Form criteria using a list box

    Wayne there seems to be a problem with the "_" that is used in the below code i.e. the code that is highlighted DoCmd.OpenForm "Viewtonnage", , , _ "[tblSettings.Line_number] = '" & Me.lstSearch.Column(0) & "' AND " & _ "[tblSettings.Part_number] = '" & Me.lstSearch.Column(1) & "'"
  8. A

    Form criteria using a list box

    Hi, I have a table called tblSettings which has the primary keys Line number and Part number Now I want to produce a list box which matches a certain critera (which Ive managed to do!). However I want to be able to click on the tuple from the list which inturn opens the details corresponding...
  9. A

    If statement

    Apoligies ignore the ElseIf statement. It should just be Else
  10. A

    If statement

    I previously produced a tick box in a form with the use of a Yes/No data type. However i wanted to produce code that display a number of objects if the the box is ticked. Hence I produced the following code Private Sub Partsseperate6_AfterUpdate() If Partsseperate6 = True Then...
  11. A

    Changes from a combo box

    Im back! Apoligies in the long delay for this reply but Ive been on holiday. Modest is there anyway you could explain what this code does as Im rather confused!
  12. A

    Changes from a combo box

    I owe this forum my life! I have a combo box with no default value i.e. there is no value in the combo box when the form is loaded. When the combo box is updated from one certain value to another I want to make the neccessary changes. However if the box is changed from another value to a...
  13. A

    Message box error

    Modest This is what I meant when saying that I didnt need to declare the variables. PressInnerMax is a value entered into the database via the user. This PressInnerMax is just a variable that stores the maximum allowed tonnage. However the company in question recommends that a tonnage of 80% of...
  14. A

    Message box error

    Private Sub Innertotal_BeforeUpdate() Dim PressInnerMax As Integer Dim Recommended1 As Integer Dim Innertotal As Integer ' Not sure about this because this is a calculated field Recommended1 = (PressInnerMax * 0.8) If Innertotal > Recommended1 Then If MsgBox("The tonnage exceeds the...
  15. A

    Message box error

    Rich Im now getting the message box to appear when Im about to exit the form. Essentially I need it to appear as soon as the total from the four text boxes goes over the recommended tonnage. Modest Im awful on VBA so I dont really know how to declare a number variable using Dim. Is the...
  16. A

    Message box error

    Modest! Thanks for the suggestions! The datatype of Press2Max is a number. This field stores the maximum value allowed for each Press. Recommended is then used to calculate the recommended tonnage which is 80% of the maximum tonnage hence the calculation recommended = (PressInnerMax * 0.8)...
  17. A

    Message box error

    Im not storing the calculated total but it still must be displayed on the form! The text box innertotal displays the total of four user inputs! Then this total must be checked to see if tonnage exceeds the recommended tonnage.
  18. A

    Message box error

    In a form Ive created I have data entry field that prompts the user to enter a figure which we will call tonnage. I then using the below code check to see if this number is valid i.e. whether it is above the recommended tonnage Private Sub Tonnage2_BeforeUpdate(Cancel As Integer) Recommended2 =...
  19. A

    Adding Tax to a total

    Tax calculation Im not sure why but many experts on this forum dont believe in storing a calculated expression in a table. Hence in the form type the following into the Control source of a text box which we will call Total cost including tax; =[Original cost without tax * 0.17]+[Original cost...
  20. A

    Refreshing a data entry form after saving data

    Thanks edtab Yeah that worked perfectly! As I said when beginning the thread I couldnt believe this hadnt been discussed! Asentry in terms of the Save button its simply there for the clients benefit! They believe that without pressing the save button the information is not saved. Despite...
Back
Top Bottom