Search results

  1. Howlsta

    combo boxes pointing to foreign key

    Thanks, but not sure this example is quite the same. In the example you gave the user selects the store number which is equivalent to vehicleID in my problem. If I enter VehicleID the model and make will appear, but this is not what I want to do. VehicleID is meaningless to the user. The user...
  2. Howlsta

    combo boxes pointing to foreign key

    I know this is easy but haven't done it for ages and can't find my book. I've got a form of accident details. The form it's based on has a vehicle ID field which is the foreign key. I want the user to be able to select the model and make of the car from the combo boxes then Access will store it...
  3. Howlsta

    Looking for part of a date

    thanks ps got the problems sorted sSQL = "DELETE * FROM [Attendant circumstances] WHERE (Year([Date]))LIKE " & MyYear had to write a whole query, not just the field. Hence the second query became: sSQL = "DELETE FROM [Casualty Details] WHERE [Casualty Details]![Crash Reference] NOT IN...
  4. Howlsta

    Looking for part of a date

    Sorry forgot to mention, this is in VB code, so I won't need to put in forms!etc at the moment, will I?. Well, when I tested it with another field it worked without it anyway.
  5. Howlsta

    Looking for part of a date

    Thanks, but I Still can't get it working sSQL = "DELETE * FROM [Attendant circumstances] WHERE [Date] LIKE '*' & Year g_DataConnection.Execute sSQL P.S: 1) have you defined sSQL? Yes defined, I already tested it with other fields and it deleted them okay, but as i'm just looking for the...
  6. Howlsta

    Looking for part of a date

    Simple problem I want to delete all records from a table where the year is the same as entered in a text box. The format of the date column is dd/mm/yyyy can't seem to get the syntax correct to look for the year within the date. I've searched but can't find an example, although it must have...
  7. Howlsta

    Delete records by year problem using VB code

    I have to write a program in VB that will delete some records from a database that the user browses for on a VB form. The user will be able to enter the year that they would like to delete the records from. Then the program will open a recordset and look through a table of accidents and delete...
  8. Howlsta

    C Forums

    Hi Everyone! Just wondering, does anyone know if there is a forum as good as this for C programming. I've just started using it and have done an Internet search, but didn't find the sites as useful as this one. cheers Rich
  9. Howlsta

    Message Box with Number

    Msgbox "The request has been updated. Request Number " & intrequiredno
  10. Howlsta

    Common Dialog Box Not working Properly

    John, Here is an example of how you can filter the files Private sub mnuOpenFile() 'set filters commondialog1.filter = "All Files (*.*)|*.*|text files (*.txt) |*.txt| batch files (*.bat)|*.bat" 'Set default filter commondialog1.filterindex = 2 ' display the open dialogbox window...
  11. Howlsta

    Stubborn Subform

    This should do the trick.... put the following code in the lost focus event of the last control on your main form. Forms!yourmainform!yoursubform!yourcontrolonsubform!setfocus I'm presuming that you want the first control on the subform to get focus everytime you tab into the subform. best...
  12. Howlsta

    Please Help! VB being arsey!!

    Ben, Glad to help. So is the second loop working OK then? Must have been my computer not responding before, I thought it had got stuck in the loop and had to shut down the application. :eek:
  13. Howlsta

    Please Help! VB being arsey!!

    you need to refer to table field names like this: rs!roomno etc I noticed your trying to add 1 to the date. You cannot to a date in this way, it will cause a type mismatch. change this StartDate = StartDate + 1 to StartDate = DateAdd ("d",1,StartDate) and change the format of the two...
  14. Howlsta

    Focus Problem

    Tom, You could make the form modal, this will make it have focus all the time it is open and another form won't get focus until it is closed. Alternatively, the switchboard might be modal and this could have caused the problem. Have a look at the modal property in each forms property window...
  15. Howlsta

    Cancel out of Quit Database

    can't you just do something like this? Private Sub yourCommandbutton_Click() Dim intReturn As Integer intReturn = MsgBox("Do you want to quit application ?", vbYesNo, "Quit ?") If (intReturn = vbYes) Then DoCmd.Close End If End Sub Rich
  16. Howlsta

    Record check

    Try this (if you are dealing with a text field), it is simpler than using a recordset If DCount("[YourField]", "YourTable", "[YourField] like " & "'" & "*" & yourTxtbox & "*" & "'") > 0 Then MsgBox "Existing" End If I'm not sure how to get it to work for a number field type though...
  17. Howlsta

    Record check

    Look up DCount in help or search for it here. if dcount (etc...) >0 then msgbox "existing" Rich
  18. Howlsta

    Text boxes on form show Time, should be blank

    This is probably unlikely, but the fields could be locked. Go to the properties of the fields in question and make sure locked is set to 'No'. So, can these fields 'get focus' or are you simply getting an area message when you try to make any alterations? If so, what's the error message?
  19. Howlsta

    Text boxes on form show Time, should be blank

    For the second bit Check the form properties. Make sure that 'allow edits' is set to yes. It could be something else though is the form based on a query (some types of query don't allow updates). HTH Rich
  20. Howlsta

    Only view label on form if text box is not null

    Beth, There's a few ways of doing this, but the quickest way is to remove the Is Null bit and check for the empty string instead If Me.Notes1 = "" Then etc .... I'm pretty sure this should do it. Rich
Back
Top Bottom