Search results

  1. G

    Allowing selection of null from combobox

    So if the user select a value that is in the combobox, sometimes he will get the message : "The text you entered isn't an item in the list." So if I am correct you ask the user to select a text from a pre-defined list. If the user selects one you tell him that it isn't an item of the list ...
  2. G

    Command Button is not functioning

    I use single quotes for strings. I work all day with Microsoft SQL manager... If you try to use double quotes, the sql gives a nice error. But in Access you can use both. But the problem of the OP's query was that he missed the first quote in this part : where LoginID = " & Me.cboUser & "'"
  3. G

    Command Button is not functioning

    You know that SQL doesn't use double quotes ? You need to use single quotes when updating strings. So you need : strSql = "update tblUser set txtPassword = '" & Me.TxtNew & "', dteChanged = #" & Date & "# where LoginID = '" & Me.cboUser & "'" Same in the DLookup. You are missing the first ' in...
  4. G

    Command Button is not functioning

    Maybe it is a good habit to name the controls with a meaningfully name. Private Sub Command14_Click() Dim strOldPassword As String Dim strSQL As String strOldPassword = DLookup("[password]", "tblUser", "[LoginID] = '" & Me.List25 & "'") Select Case strOldPassword Case Is = Me.Text10 // Is this...
  5. G

    Visa Database

    Well in the RowSource proprety of the visa dropdown-box there is a query : SELECT Visa_Category.Id, Visa_Category.Visa_Name FROM Visa_Category WHERE (((Visa_Category.FK_Country)=[forms]![Demo_Form]![Selection_Country])) ORDER BY Visa_Category.Id; So basicly it will select all the visa records...
  6. G

    Combo boxes that use the same data source

    I like that kind of solution. But I followed this instruction : "I need to ensure that each diagnosis is chosen once and only once, and that DIAG_ONE is chosen first, DIAG_TWO is chosen second, etc etc" It is not really clear what the OP expect us to do. Maybe you can try something that you...
  7. G

    Combo boxes that use the same data source

    Well you said : "Numbers must not be repeated or missed out; so it's 1; 1,2,3; 1,2,3,4,5; however many. " For me they are in order :p If you don't care about the order, just add the condition of the previous box to the where. So where Daig_number <> DAIG_1 for the second box where DIAG_number...
  8. G

    Can someone check my query please

    Here is a more practical example : Dim rs As DAO.Recordset Set rs = CurrentDb.OpenRecordset("SELECT Tbl_BespokeInspectionAreas.BespokeID, Tbl_BespokeInspectionAreas.BespokeNumber, Tbl_BespokeInspectionAreas.BespokeInspectionArea FROM Tbl_BespokeInspectionAreas WHERE...
  9. G

    Combo boxes that use the same data source

    Here is a little demo of what I think you want : http://www.access-programmers.co.uk/forums/attachment.php?attachmentid=64542&stc=1&d=1479807975 So basically you have to select the first one first. Then for all the next options you don't have the previous options. So if you pick first 4 the...
  10. G

    Can someone check my query please

    Ok, sorry I should have seen that you try to use Docmd.RunSql... that command is only for query's that make changes to the database (insert/delete/update) What you need is this : Dim rs As DAO.Recordset Set rs = CurrentDb.OpenRecordset("SELECT Tbl_BespokeInspectionAreas.BespokeID...
  11. G

    Trouble making query from drop down box on a form

    So regardless of the design of the database, did you get the query working ?
  12. G

    Can someone check my query please

    Do you have any message error ? Also i guess BespokeID is a primary key, so there shouldn't be any record in your table where it is null. The where is pretty useless in that case.
  13. G

    Trouble making query from drop down box on a form

    I agree on that point. His database is not normalised. But when a working query he can tweak the database and modify the sql to fit his new design.
  14. G

    Number of query values and destination fields are not the same

    You can just format the decimal field. Format(Me.[Amount],"Standard") But if the amount is not a decimal then you still get errors.
  15. G

    Number of query values and destination fields are not the same

    The line must be this : Debug.print "INSERT INTO tblTransactions ([Account1ID], [Account2ID], [TransactionDate], [TransactionType], [TransactionCategory], [Amount])" & _ " VALUES ( " & Me.[Account2ID] & " , " & Me.[Account1ID] & " , #" & Format(Me.[TransactionDate], "mm/dd/yyyy") & "# , '" &...
  16. G

    Strange Modal Form Behaviour

    Windows 7 and Access 2016. I cannot click on frm1. It is a strange behavior... Or maybe a windows 10 thing. Maybe they keep track of the number of modal windows and descide only 1 modal view can be displayed on screen and make the frm2 default non modal.
  17. G

    Trouble making query from drop down box on a form

    Well yes you can add a table to store the history. But that will not be a function table in that case. It will just be a table with an unique ID and 2 FK : WidowID and LegaleeID. He just wants a list of other Widow's that have currently that legalee. In my query I excluded the widow that the...
  18. G

    Trouble making query from drop down box on a form

    Change the query WhichOthers with this : SELECT Widow.WidowName, Widow.WidowLegatee, Legatee.LegateeName FROM Widow left join Legatee On Widow.WidowLegatee = Legatee.LegateeID WHERE (((Widow.WidowLegatee)=[Forms]![Widow]![cmbWidowLegatee]) AND ((Widow.WidowId)<>[Forms]![Widow]![WidowID])); You...
  19. G

    vba code to set values in different variables in Loop

    Yes sorry. That is correct. So for each score you have a header and a record. But I don't see why you need headers since you want to display the score in one table. Why not just use the query as datasource ? Example : Set WordDoc = WordApp.Documents.Open(strTemplatePath & "Health Check...
  20. G

    Display the answer of each question in word document from Access form

    I am confused now. You show code from an other topic (the one were scores needs to be displayed in word) And here it is the answer of each question. So what do you want here ? scores or answers ?
Back
Top Bottom