Search results

  1. W

    VB Error, Expected: end of statement.

    Private Sub txtCN_Click() Dim sPrefix As String Dim Mysql As String Dim sKey As String Dim sSuffix As Integer Dim X As Integer Dim conn As New Adodb.Connections Dim rs As New Adodb.Recordset I get the error highlighted at Dim conn As New Adodb.Connections The error I get is Compile...
  2. W

    Can anyone tell me what is wrong with this please? (Expected: end of statement)

    Mysql = "SELECT Max(CDbl(Mid([YouFieldName]," & X & "))) AS NewNum" FROM tbl_YourTblName Where YourFieldName Like '" & sPrefix & "*'" I get the error highlighted at Where The error I get is Compile error: Expected: end of statement. Can anyone help please?
  3. W

    Two prefixs in a text box, get next number for each prefix?

    Hi all, I have a text box which is partly filled by the code Private Sub cboSeg_AfterUpdate() If Not IsNull(Me.CBOsEG) Then If Me.CBOsEG = "C&I" Then Me.txtCN = "C-" Else Me.txtCN = "P-" End If Else Me.txtCN = "" End If End Sub However what I want to do now...
  4. W

    Prefix Text box based on combobox selection

    SOLVED: Prefix Text box based on combobox selection Hi all, I want to add a prefix to a text box based upon a selection from a combobox. Specifically, if cboSeg = C&I txtCN prefixed 'C' if anything else prefixd 'P' and if nothing, no prefix. Can someone help me with this please...
  5. W

    Taking data from one table to another and then summing?

    Hi all, I have a form which is allowing input of equipmet info. To keep is simple I have tried to dumb it down as much as possible. Here is an example of the table with some data in. Now my aim is to be able to have a table which creates a unique record for every combination of location...
  6. W

    WIll this code autofill a textbox from table value with three 'WHERE's?

    Private Sub cboC_AfterUpdate() On Error Resume Next txtW.RowSource = "Select tblCables.W " & _ "FROM tblCables " & _ "WHERE tblCables.T = '" & cboT.Value & "' And tblCables.C = '" & cboC.Value & "' And tblCables.N = '" & cboNCA.Value & "' " & _ End Sub I have...
  7. W

    Make data input into form from comboboxes, text boxes etc write to table

    Hi all, I have a form made now and a table created which I want the form to write to. Is there a way I can make the form write data to this specific table and specific field? E.g. I have put cascading comboboxes in and I want the info selected from these, from other table to be entered into...
  8. W

    On click textbox inserts value back on combobox

    Hi all, Thanks for your help so far my database is moving along nicely. I have something I want to add though and this is that on click in a text box the text box will look at another value in a combobox and based on that value with insert a specific letter. E.g. If cboT.Value =...
  9. W

    Form to write record to specific table based upon a value?

    Is there a way to get a form to write a record to a specific table based upon a value? Ideally this value would be True/False ie a check box or via a selection. I have one form to input data but I want the record to be written to one of 5 fields based upon a value. Thank you in advance...
  10. W

    Cascading Combobox based on TWO "WHEREs?

    I want a combobox based on the value of two other comboboxes but I am not sure how to write it in VB. I would have though something like: Private Sub cboT_AfterUpdate() On Error Resume Next cboC.RowSource = "Select DISTINCT tblCables.C " & _ "FROM tblCables " & _ "WHERE tblCables.T = '" &...
  11. W

    Using a checkbox to get a value from a table.

    Hi all, I want to use a combination of two checkboxes to retrieve a value from a table however that table is quite complex. My table consists of four fields: 'Flower', 'NumberofFlowers', 'Weight1' and 'Weight2'. E.g. Select type of flower in combobox, and then the number of flowers...
  12. W

    Question Generate info from form selections?

    I want to create a form with cascading combo boxes ... but I want to generate coes from this e.g. E.g. Drop Down 1 Meat Vegitables Drop Down 2 (when meat has been selected in 1) Beef Lamb Pork or Drop Down 2 (when veg. has been selected) Carrot Pea I have done that with cascading...
  13. W

    Multiple Drown Down Boxes

    Hi, I want to use a drop down list containing one value, and depending upon this value I want my next dropdown box to only display certain options. Is this possible? E.g. Drop Down 1 Meat Vegitables Drop Down 2 (when meat has been selected in 1) Beef Lamb Pork or Drop Down 2...
  14. W

    Input Mask

    Hi there, Really simple one (but I'm new to Access!). Just trying to have a look about before I start some serious training. I am trying to make a mark for a UK post code field. Post codes in the UK can either be XX1 1XX or XX11 1XX Where: X = Letter 1 = Number. I was just...
Back
Top Bottom