hi, tkx to welcome me in here!
i have wrttien a program in vb6 that uses ms access. the program is a attendance monitoring system, that uses the time to calculates hrs late and early of employees.

im having problem
i dnt know how to make validations in vb6 ex: if i wrongly enter a time e.g i insert a num, the program exitshlp plz

Dani AI

Generated

The crash described by is a classic input-validation issue in VB6/Access apps. is right to point toward built-in date checks; beyond that, the most effective fixes are to stop free-text time entry and to defend every conversion and database write.

Recommended practical steps:

  • Replace free-text entry with a Date/Time picker control where possible; that prevents most malformed values at the UI level.
  • If using a TextBox, enforce a strict pattern (hours/minutes) while typing and validate the parsed parts (hours 0–23, minutes 0–59) before any conversion or arithmetic.
  • Centralize validation so every place that accepts a time uses the same routine; run that routine on lost-focus, on submit, and before writing to Access.
  • Use structured error handling around conversions and DB operations so the app shows a friendly message and logs the problem instead of exiting.

Data-handling and debugging notes:

  • Store clock-in/out values as Date/Time in Access and use parameterized commands or proper recordset fields to avoid type-mismatch errors when inserting/updating.
  • Keep raw timestamps in the database and compute "minutes late" at read time so rules can be changed later without losing source data.
  • To find the crash, run the project inside the VB6 IDE, step to the failing line, inspect variables, and add logging around the conversion and DB code.

A final caution for sharing the system (as requested): remove real employee data and include a short README describing required OCXs/components and the Access schema so others can reproduce the issue safely.

Recommended Answers

All 2 Replies

hi,


To check the Date entered by the user, use "IsDate" function. Use the below coding.


If IsDate(Text1.Text)=False then
msgbox "Wrong Data"
End If

Regards.
Shailu.:)

may i get your system for further more understanding??? here's my email thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.