Search results

  1. S

    How to move the data from a table to another

    Glad it finally worked. At the end of the loop, strTable1Fields will look like: "[Name],[PolicyNo],[Age],[Benefit]," Notice the comma at the very end of the string. If you use this string, the final SQL statement will be invalid. So you have to strip that comma. Generally, INSERT Statement...
  2. S

    How to move the data from a table to another

    Oops. It should be like: Set db = CurrentDb Set rs = db.OpenRecordset("Mapping")
  3. S

    How to move the data from a table to another

    pikkhuanloy, I just saw your reply. What does the error message say?
  4. S

    How to move the data from a table to another

    Hi pikkhuanloy, spikepl is right. You can tell me exactly what happened when you ran the code. But I will add some explanations. I was assuming that your field names are just examples, not the real names, and you are dealing with more fields. So, my code tries to solve the problem more...
  5. S

    How to move the data from a table to another

    Here is the answer. 1. Create a Module and copy the following: Sub TransferData() Dim db As Database Dim rs As Recordset Dim strTable1Fields As String Dim strTable2Fields As String Dim strSQL As String On Error Goto Err_TransferData Set db = CurrentDb Set rs =...
  6. S

    Form With Two Comboboxes - DAvg

    Yes, many things are wrong. 1. You cannot refer to a value of a table as you do. 2. "[cbxAssociate]" does not refer to the value of the combo box. It refers literally to the string "[cbxAssociate]". 3. You cannot just write a SQL statement inside IIF function. A SQL statement is a string, so...
  7. S

    Running balance on form

    Cristina, It is difficult to answer your question unless you tell us more about your table structure. Since you mentioned "Running balance", is this a list? If so, you should work on a totals query. Also, google for DSum function.
  8. S

    Subform naming - best practise

    Oh, I get it. My preference is using the same name for the control and control source. But in some cases you may want to use the same control (place holder) for several sub forms. Yes this is a good way to bunch all related forms and subforms together. In my case, however, I have a number of...
  9. S

    Subform naming - best practise

    Forms: frmXXX Sub Forms: subfrmXXX or sfrmXXX Indicate whether it is a form or sub form in the prefix part so that they are listed together. What is important is the once you settle with the style, stick to it all the time.
  10. S

    Multi list to select reports send by email

    Thanks. This is exactly what I needed.
  11. S

    Multi list to select reports send by email

    You should do something like this: Dim I As Integer For I = 0 To ReportList.ListCount - 1 If ReportList.Selected(I) = True Then DoCmd.SendObject acSendReport, ReportList, acFormatTXT, _ sAddr, , , sSubj, "Attached is a copy of " & ReportList(I)...
  12. S

    Fill multiple date fields in the form with the first value

    Chieltje, I think you are not explaining your question clearly. But let me try to understand your question. The user will open a query. Then, the query has 2 filters(year and quarter) as they are prompted. When the user enters these filters, the query shows the result based on the filters. Did...
  13. S

    Cancel appointment

    CStr is a function to convert a number into a string. A SQL string is a string and you should not concatenate a number to a string directly, even though that will work anyway. Look for it in Google. I would be happy to follow up with the rest, but for now I have to go away from the computer. Shoji
  14. S

    Cancel appointment

    You don't (should not) need a separate form for cancelling appointments. There should be a list of all the appointments (a continuous form or a listbox), and there should be a button for editing and another for deleting. Or if you click (double-click) the line for an appointment, it opens a...
  15. S

    Verification Rule based on data in another field

    No problem.
  16. S

    Multi Column Combo Box

    Great. Judging from your description, I gather that this continuous form is a sub form. In that case, when the main form is populated, you add this line at some appropriate place: Me.<sub form name>.Requery Now where this line should be placed is dependent on how you populate the main...
  17. S

    Verification Rule based on data in another field

    You can create a BeforeUpdate event for the field of "Status" like Private Sub Status_BeforeUpdate(Cancel as Integer) If Nz(Actual Closure Date) ="" Then MsgBox "Actual Closure Date is required first." Cancel = True Status.Undo End If End Sub BTW, if "Actual...
  18. S

    Subform combobox sorting question

    Oh, if the combo box's value must be PartID, then you should write SELECT PartID, Description FROM ... and on the combo property sheet, make sure of the following: Bound Column: 1 Column Count: 2 Column Widths: "0;2" 2 is the width of the column, just as an example.
  19. S

    Subform combobox sorting question

    Yes. If you put the table name back, the combo box shows the list of the table, right? But which field would you like to show in the combo? So, if you want to show "Description", just replace the table name with SELECT Description FROM MyTable ORDER BY Description;
  20. S

    Subform combobox sorting question

    Hmm. How do you get the data for the combo box?
Back
Top Bottom