Search results

  1. Kiwiman

    Combo box issues :s

    Howzit What is the recordsource of your subform?
  2. Kiwiman

    Form/Subform help pleasee!

    Howzit When you got the data mismatch earlier we changed the code, we changed the code on the basis that the criteria field AppointmentType was correct. In fact it is the wrong one, it should be AppointmentTypeID Your solution should be Private Sub Combo10_AfterUpdate() Me.CPH =...
  3. Kiwiman

    Form/Subform help pleasee!

    Howzit Can you post the recordsource of the como10. Also what is the bound column of the combobox. What actually showed in the messagebox?
  4. Kiwiman

    Form/Subform help pleasee!

    Howzit Sorry I thought that meant that the msgbox returned S. When you ran this code some value showed in a messagebox Private Sub Combo10_AfterUpdate() msgbox me.combo10 Me.CPH = DLookup("[CPH]", "tblAppointmentTypes", "[AppointmentType]='" & Me.Combo10 & "'") End Sub That value I assume...
  5. Kiwiman

    Form/Subform help pleasee!

    Howzit I could just give you the answer, but this way you may get it. This is from your post 15, where you unknowingly provided the solution Your combobox returned S so in the criteria part of the dlookup you need to use the field in tblAppointmentTypes that holds the value S. In your case...
  6. Kiwiman

    Form/Subform help pleasee!

    Howzit Go back to the way it was and take a closer look at which section you should change based on my comment in 16.
  7. Kiwiman

    Form/Subform help pleasee!

    Howzit I suspect that you need to use the field AppointmentTypeID in your dlookup not AppointmentType as this is the field that is storing "S"?
  8. Kiwiman

    Form/Subform help pleasee!

    Howzit The syntax is correct. Do you have costs populated in the table tblAppointmentTypes? Does the combobox return the expected value? When the code below runs what value shows in the message box - is it the expected value - i.e. the appointment type? Private Sub Combo10_AfterUpdate()...
  9. Kiwiman

    Form/Subform help pleasee!

    Howzit I assumed that the appointment type was a number - but it looks like it is text. Therefore you need the following Private Sub Combo10_AfterUpdate() Me.CPH = DLookup("[CPH]", "tblAppointmentTypes", "[AppointmentType]='" & Me.Combo10 & "'") End Sub
  10. Kiwiman

    Form/Subform help pleasee!

    Howzit Nice one. Take the spaces out either side of the table name. You show Me.CPH = DLookup("[CPH]", " tblAppointmentTypes ", "[AppointmentType]=" & Me.Combo10) Where you want Me.CPH = DLookup("[CPH]", "tblAppointmentTypes", "[AppointmentType]=" & Me.Combo10)
  11. Kiwiman

    Form/Subform help pleasee!

    Howzit As it is course work you should try and muddle through this as best you can - we will offer guidance where necessary. Post the code that you have currently. You should have an event procedure something like the below where YourcomboCtrl and me.costperhour and me.appointmenttype are...
  12. Kiwiman

    Referencing a fields from a form, from within a subform

    Howzit What field are you linking it on? You can link on multiple fields. On your subform control properties go to the Data tab and click on the Link Master Fields elipses button. In here you specify the fields that are related in the main and subform tables. It is these and any defaults...
  13. Kiwiman

    VBA Emailing subform records

    Howzit This is an what I have used to send a user all cost centres they have access to. In this case I am emailing the cost centre and the costcentrename See if you can modify this: Option Compare Database Option Explicit Dim sTo As String Dim sCC As String Dim sBCC As String Dim sSub As...
  14. Kiwiman

    Form/Subform help pleasee!

    Howzit Me. is a shortcut to reference controls on your current form \ report, instead of having to do the full referencing like Forms!Mainform!ControlName me.costperhour means that there is a control on your current form called costperhour Check this out for a better description of control...
  15. Kiwiman

    Form/Subform help pleasee!

    Howzit After the selection of your appointmenttype field as it is only then that yoy have the information to perform the Dlookup to get the cost for that appointment type.
  16. Kiwiman

    Form/Subform help pleasee!

    Howzit Yes create a combobox to select the appointmenttype then in the after update event procedure use dlookup to populate the cost Something like me.costperhour = dlookup("[yourcostfield]","yourappttypetable","[yourapptmenttypefield]=" & me.appointmenttype)
  17. Kiwiman

    Referencing a fields from a form, from within a subform

    Howzit Check this out or referencing form controls. Also if these two fields are bound fields in the underlying tables, you can specify the link (tell access which fileds in the main and subform tables are linked) in the subform properties so that it is automatically populated.
  18. Kiwiman

    Open Form Where Clause

    Howzit Try DoCmd.OpenForm "DataCheck_frm", , , "[Date] =#" & Dt & "#"
  19. Kiwiman

    Customise toolbar/ ribbon button?

    Howzit See this to add to your QAT. I have tried this on Excel 2010 and it works - but I needed to select the QAT then Select Macros.
  20. Kiwiman

    Delete Blank Column but skip header row

    Howzit This should work. You will need to chage "Sheet3" to your sheetname Sub Del_Empty_Cols() Dim lngLastCol As Long Dim lnglastRow As Long Dim i As Integer ' Get the last column populated - this assumes that each column ' has a column header and the column header is on row 1 lngLastCol...
Back
Top Bottom