samonwalkabout
Registered User.
- Local time
- Today, 02:44
- Joined
- Mar 14, 2003
- Messages
- 185
I have set up a large access 2000 data base. I have a form where a user inputs a Project number ie. 123/02 and then clicks create. This textbox is called Intial. It runs code as follows....
Private Sub create_this_record_Click()
On Error GoTo Err_Create_this_record_Click
Forms]![create record]![TS] = Me.Inital
[Forms]![create record]![labs1] = Me.Inital
[Forms]![create record]![llabs2] = Me.Inital
[Forms]![create record]![pp1] = Me.Inital
[Forms]![create record]![pp2] = Me.Inital
[Forms]![create record]![com] = Me.Inital
[Forms]![create record]![plant] = Me.Inital
[Forms]![create record]![pre1] = Me.Inital
[Forms]![create record]![pre2] = Me.Inital
[Forms]![create record]![dept] = Me.Inital
[Forms]![create record]![sign] = Me.Inital
[Forms]![create record]![loc] = Me.Inital
[Forms]![create record]![ott] = Me.Inital
[Forms]![create record]![pm] = Me.Inital
[Forms]![create record]![time] = Me.Inital
Exit_create_this_record_Click:
Exit Sub
Err_Create_this_record_Click:
'MsgBox "There has been an Error Please Ensure number is not in use", vbExclamation, "PLEASE CLOSE THE DATABASE AND START AGAIN" 'inform the user
Resume Exit_create_this_record_Click
End Sub
I realised at the time that this may cause some porblems but i bundered on anyways!! Now i have hit a major problem. When the database was split the code stopped working.. i realise this is because the tables are no longer in the same location as the form and code!
What im wondering is
1. how can i fix it quickly
2. should i be using better VB code to create these records
3. Have i basically set up the whole tables and realtionships wrong.
The 5 digit number ie.123/03 is the primary key for each table and each table is linked via this. Everything else works fine and qrys are very easy to build.
Any help???
Private Sub create_this_record_Click()
On Error GoTo Err_Create_this_record_Click
Forms]![create record]![TS] = Me.Inital
[Forms]![create record]![labs1] = Me.Inital
[Forms]![create record]![llabs2] = Me.Inital
[Forms]![create record]![pp1] = Me.Inital
[Forms]![create record]![pp2] = Me.Inital
[Forms]![create record]![com] = Me.Inital
[Forms]![create record]![plant] = Me.Inital
[Forms]![create record]![pre1] = Me.Inital
[Forms]![create record]![pre2] = Me.Inital
[Forms]![create record]![dept] = Me.Inital
[Forms]![create record]![sign] = Me.Inital
[Forms]![create record]![loc] = Me.Inital
[Forms]![create record]![ott] = Me.Inital
[Forms]![create record]![pm] = Me.Inital
[Forms]![create record]![time] = Me.Inital
Exit_create_this_record_Click:
Exit Sub
Err_Create_this_record_Click:
'MsgBox "There has been an Error Please Ensure number is not in use", vbExclamation, "PLEASE CLOSE THE DATABASE AND START AGAIN" 'inform the user
Resume Exit_create_this_record_Click
End Sub
I realised at the time that this may cause some porblems but i bundered on anyways!! Now i have hit a major problem. When the database was split the code stopped working.. i realise this is because the tables are no longer in the same location as the form and code!
What im wondering is
1. how can i fix it quickly
2. should i be using better VB code to create these records
3. Have i basically set up the whole tables and realtionships wrong.
The 5 digit number ie.123/03 is the primary key for each table and each table is linked via this. Everything else works fine and qrys are very easy to build.
Any help???