If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#21
|
|||
|
|||
Customer Count Database
The fuction you posted would not go in the code I posted because your field
is a date field. You need to do the formatting on the report or form when you display it. As I said, Dates are not stored formatted. You format dates when you present them on a report or form. -- Dave Hargis, Microsoft Access MVP "Mr-Re Man" wrote: The module you gave me here (part of).. Subject: Customer Count Database 6/2/2008 9:53 AM PST By: Klatuu In: microsoft.public.access.tablesdbdesign -- Dave Hargis, Microsoft Access MVP "Mr-Re Man" wrote: Thank you for the fast response, its was as fast as your solution. Excuse my typing in capitals, it is only to ask a question based on your response. This will be very simple and very fast for the reception people to use. Create a form that has a command button for each department. In the form module, put a sub like this: WHAT IS A FORM MODULE, IS THIS A LINK IN THE FORM WITH THE BUTTONS I JUST CREATED OR SOMEWHERE ELSE? A form module is the module that is attached to the form. When you click on the Code Builder option in the event procedure, it opens the form's module in the VB Edtior. Nothing magic about it. So, the answer is yes. Private Sub AddVisitor(VisitDept As String) Dim strSQL As String On Error GoTo AddVisitor_Error strSQL = "INSERT INTO tblDeptVisits ( Dept, VisitTime ) " & _ "SELECT """ & VisitCity & """ AS Expr1, #" & Now() & "# AS Expr2;" CurrentDb.Execute strSQL, dbFailOnError The Now(), that is what i guess is making the date do strange things. The results then populate a table directly. "Klatuu" wrote: That format is for a US date, don't you want "dd\/mm\/yyyy"? Where do you want to present the results? -- Dave Hargis, Microsoft Access MVP "Mr-Re Man" wrote: Do you think this code would help, Function SQLDate(vDate As Variant) As String If IsDate(vDate) Then SQLDate = "#" & Format$(vDate, "mm\/dd\/yyyy") & "#" End If End Function It was taken from a website that indicates that dates in SQL seem to stick to American formats and this code above should allow for other countries, namely UK to capture the correct format. I have tried to call it from the module you gave me, but wasn't sure how or if it would work. If I was in America this thread would have finished a long time ago |
#22
|
|||
|
|||
Customer Count Database
Hi Klatuu, I'm wondering if you could continue to provide me with some good
advice and codes. The help you provided me with on this short database has proved a success, and now like all things, management now want to build on it. So, as well as just clicking a box to record a visitor, they want to now record how that communciation was made (eg, Telephone, Email, Face-2-Face). What would be the best solution for this with my current set-up. hope you see this regards, Richard |
Thread Tools | |
Display Modes | |
|
|