can't enter data on form fields

G

George Applegate

I am having a problem in MS/Access, and I don't know that much about
it and would appreciate any help/direction. Sorry this is so long in
advance.

Over the weekend we moved to a new server. We have an access data
base dealing with warranties and related information. In the access
programs, it referred to a customer master file for name/address/etc.
that was linked to a server data base. When we migrated to the new
server that database went away, however, we have an as/400 that I
changed the pointers and associations to for customer information in
the access database - so, instead of pointing to the server for the
customer data base, it now points to the as/400 for the customer data
base information. Until I did this, I was getting errors when it
would be looking for those customer fields. Once I changed each query
to go to the as/400 customer file/fields everything seemed fine.

Until we open the warranty form. Almost all the fields in the
warranty form now seem protected - I can put my cursor into the field,
but I can't change any of the information. Some fields at the bottom
of the warranty entry form I can update and add information to, but
most of the fields on the form I can't change - and I could before.

What would cause this? I am including the visual basic code at the
bottom of this if someone wants to look at it. I didn't know how much
of the form to upload/or could upload so just did the vb code.

I am also getting a 2105 error at the line in bold (code shown below).
Now I am assuming from what I have found on googling 2105, that I
somehow need to give it more time to load the customer database with
the warranty???? How can I do that in vb?? Suggestions??

But why would these fields, which worked fine before, now suddenly not
be modifiable? Also, when I bring up an existing warranty it's the
right data shown, I just can't hardly change any of the fields - and
it wasn't that way before. The customer fields only come into the
form - but then you can override them; also, the form contains MANY
OTHER FIELDS not in the customer file and none of those can be
modified either. Most of the fields that I can't modify are in the
query that links to the customer file. I think I cannot modify any
fields on the form that come from the warranty file, which is linked
through a query to the customer file. But I can't modify any warranty
fields, whether customer related or not. Also, as I said, I can
update some data on the form and that seems to be "sub-forms". There
are 3 sub-forms. Also, if I just edit the table it works fine, it's
just that I can't change the fields using the form??????

I need to get this working and I am thinking it has to be pretty
simple as all I did was change queries to point to a different
customer file than the one before, but the fields stayed the same. I
can't help but think this is all due to the fact that I changed the
customer file pointer to a new file…but since I didn't get any errors,
I'm not sure why it wouldn't work???

As I said, I'm pretty much a novice at this, I just need to get this
program working and would appreciate any suggestions on why it is
giving me the 2105 error at the point in bold, but more importantly,
WHY CAN'T I ENTER/UPDATE FIELDS on the form that I could before????

Thanks in advance
Ga

Private Declare Function WinExec Lib "kernel32" (ByVal lpCmdLine As
String, ByVal nCmdShow As Long) As Long

Private Sub Command116_Click()
CDOpen.ShowOpen
If CDOpen.FileName = "" Then Exit Sub
[WARRANTY LETTER].SetFocus
[WARRANTY LETTER].Text = CDOpen.FileName
End Sub


Private Sub Command119_Click()
WinExec "winword K:\FORMS\FORMS\300-Customers\310-1AW.DOC", 10
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = KeyAscii - 32
End If
End Sub

Private Sub Form_Load()

If Me.Filter > "" Then
DoCmd.Maximize
Exit Sub
End If

Dim ans As String, ANS2 As String

Me.Visible = False

NewClaim:
ans = InputBox("Enter Claim #")
If ans = "ALL" Then
Form.Visible = True
Exit Sub
End If

If ans <> "" Then
Form.RecordSource = "SELECT [WARRANTY WITH CUST INFO].* FROM
[WARRANTY WITH CUST INFO] WHERE [WARRANTY CLAIM #] = '" & ans & "'"
Form.Refresh
If Form.Recordset.RecordCount = 0 Then
ANS2 = MsgBox("Warranty claim not found. Start new claim?",
vbYesNoCancel)
If ANS2 = vbYes Then
[WARRANTY CLAIM #].SetFocus ---2105 error is here in debug
[WARRANTY CLAIM #].Text = UCase(ans)
VENDOR.SetFocus
ElseIf ANS2 = vbNo Then
GoTo NewClaim
Else
DoCmd.close acForm, "WARRANTY"
Exit Sub
End If
End If
Me.Visible = True

Else
DoCmd.close acForm, "WARRANTY"
End If

End Sub

Private Sub Form_Unload(Cancel As Integer)
If Me.Filter > "" Then
DoCmd.Quit acQuitSaveNone
End If
End Sub

Private Sub openfile_Click()
On Error GoTo Err_openfile_Click
[WARRANTY LETTER].SetFocus

If [WARRANTY LETTER].Text = "" Then
MsgBox "Please find the file to open first by clicking on 'Find
File'"
Else
WinExec "winword """ & [WARRANTY LETTER].Text & """", 10
End If

Exit_openfile_Click:
Exit Sub

Err_openfile_Click:
MsgBox Err.DESCRIPTION
Resume Exit_openfile_Click

End Sub

George Applegate
(e-mail address removed)
 
G

Geoff

Hi George,

I don't know the specific answer to your question. However, it seems that
the fields that cannot now be modified may result from the fact that the
form in question is now opening a non-updatable recordset. Perhaps it would
be an idea to try and create an updatable query that drags the data you want
from the place you want and make that the Record Source of the form. See if
that is possible and does the trick. If is is not possible (to create an
updatable query), then perhaps that signposts your direction to checking the
link to the backend server. Does that, in some way, prevent the creation of
an updatable query?

Regards
Geoff.


George Applegate said:
I am having a problem in MS/Access, and I don't know that much about
it and would appreciate any help/direction. Sorry this is so long in
advance.

Over the weekend we moved to a new server. We have an access data
base dealing with warranties and related information. In the access
programs, it referred to a customer master file for name/address/etc.
that was linked to a server data base. When we migrated to the new
server that database went away, however, we have an as/400 that I
changed the pointers and associations to for customer information in
the access database - so, instead of pointing to the server for the
customer data base, it now points to the as/400 for the customer data
base information. Until I did this, I was getting errors when it
would be looking for those customer fields. Once I changed each query
to go to the as/400 customer file/fields everything seemed fine.

Until we open the warranty form. Almost all the fields in the
warranty form now seem protected - I can put my cursor into the field,
but I can't change any of the information. Some fields at the bottom
of the warranty entry form I can update and add information to, but
most of the fields on the form I can't change - and I could before.

What would cause this? I am including the visual basic code at the
bottom of this if someone wants to look at it. I didn't know how much
of the form to upload/or could upload so just did the vb code.

I am also getting a 2105 error at the line in bold (code shown below).
Now I am assuming from what I have found on googling 2105, that I
somehow need to give it more time to load the customer database with
the warranty???? How can I do that in vb?? Suggestions??

But why would these fields, which worked fine before, now suddenly not
be modifiable? Also, when I bring up an existing warranty it's the
right data shown, I just can't hardly change any of the fields - and
it wasn't that way before. The customer fields only come into the
form - but then you can override them; also, the form contains MANY
OTHER FIELDS not in the customer file and none of those can be
modified either. Most of the fields that I can't modify are in the
query that links to the customer file. I think I cannot modify any
fields on the form that come from the warranty file, which is linked
through a query to the customer file. But I can't modify any warranty
fields, whether customer related or not. Also, as I said, I can
update some data on the form and that seems to be "sub-forms". There
are 3 sub-forms. Also, if I just edit the table it works fine, it's
just that I can't change the fields using the form??????

I need to get this working and I am thinking it has to be pretty
simple as all I did was change queries to point to a different
customer file than the one before, but the fields stayed the same. I
can't help but think this is all due to the fact that I changed the
customer file pointer to a new file.but since I didn't get any errors,
I'm not sure why it wouldn't work???

As I said, I'm pretty much a novice at this, I just need to get this
program working and would appreciate any suggestions on why it is
giving me the 2105 error at the point in bold, but more importantly,
WHY CAN'T I ENTER/UPDATE FIELDS on the form that I could before????

Thanks in advance
Ga

Private Declare Function WinExec Lib "kernel32" (ByVal lpCmdLine As
String, ByVal nCmdShow As Long) As Long

Private Sub Command116_Click()
CDOpen.ShowOpen
If CDOpen.FileName = "" Then Exit Sub
[WARRANTY LETTER].SetFocus
[WARRANTY LETTER].Text = CDOpen.FileName
End Sub


Private Sub Command119_Click()
WinExec "winword K:\FORMS\FORMS\300-Customers\310-1AW.DOC", 10
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = KeyAscii - 32
End If
End Sub

Private Sub Form_Load()

If Me.Filter > "" Then
DoCmd.Maximize
Exit Sub
End If

Dim ans As String, ANS2 As String

Me.Visible = False

NewClaim:
ans = InputBox("Enter Claim #")
If ans = "ALL" Then
Form.Visible = True
Exit Sub
End If

If ans <> "" Then
Form.RecordSource = "SELECT [WARRANTY WITH CUST INFO].* FROM
[WARRANTY WITH CUST INFO] WHERE [WARRANTY CLAIM #] = '" & ans & "'"
Form.Refresh
If Form.Recordset.RecordCount = 0 Then
ANS2 = MsgBox("Warranty claim not found. Start new claim?",
vbYesNoCancel)
If ANS2 = vbYes Then
[WARRANTY CLAIM #].SetFocus ---2105 error is here in debug
[WARRANTY CLAIM #].Text = UCase(ans)
VENDOR.SetFocus
ElseIf ANS2 = vbNo Then
GoTo NewClaim
Else
DoCmd.close acForm, "WARRANTY"
Exit Sub
End If
End If
Me.Visible = True

Else
DoCmd.close acForm, "WARRANTY"
End If

End Sub

Private Sub Form_Unload(Cancel As Integer)
If Me.Filter > "" Then
DoCmd.Quit acQuitSaveNone
End If
End Sub

Private Sub openfile_Click()
On Error GoTo Err_openfile_Click
[WARRANTY LETTER].SetFocus

If [WARRANTY LETTER].Text = "" Then
MsgBox "Please find the file to open first by clicking on 'Find
File'"
Else
WinExec "winword """ & [WARRANTY LETTER].Text & """", 10
End If

Exit_openfile_Click:
Exit Sub

Err_openfile_Click:
MsgBox Err.DESCRIPTION
Resume Exit_openfile_Click

End Sub

George Applegate
(e-mail address removed)
 
G

George Applegate

Thanks for the suggestions, although I'n not sure I understand
everything that has been suggested. I do know that the customer file
is a "read only" file on the as/400. Today I broke the link to that
file through the query, and made it a sub-form, and now I can update
the fields in the file. I am wondering, is the warranty file
inheriting the "read-only" characteristics of the customer master
since the two files are linked in the query??? Maybe if any file in
the query is a "read-only" all the files being accessed in a form
utilizing that query become "read-only"???

Maybe I didn't explain it well enough. I have five tables - the
warranty file and then 3 other files that tie in with it, and then the
customer file. I have 3 different queries. One of the queries links
the warranty table with the customer master (as/400 - the other tables
are just on the pc in an mdb).

It's almost as if the fact that I linked to the as/400 customer file
and it was "read-only" that the actual warranty file, which was being
updated through a form that used the query that tied the warranty to
the customer file, inherited the "read-only" attribute of the customer
master. Is that possibly what is happening??? I ended up making the
part that brings in the customer file a sub-form and now it works just
fine, but it seems weird that changing customer data bases would cause
this problem, at least to me. We never updated the customer master
records, they were just there to help visually confirm the right
customer number was entered.

It's working, but I"m disappointed I couldn't just use the original
programs changing only the link to a different customer file. Just
for fun I also copied all the customer master down the the data base
in a different table, and tried to link that, and weirdly enough, it
didn't work either...but then again, maybe a new table populated from
a "read-only" table becomes "read-only" too?? I confess I'm totally in
the dark on this.

Also, the weird part was, the warranty file fields on the form could
not be updated; however we have some sub-forms on the same form and
those could be updated. So it appears something to do with the
"read-only" attribute of the csutomer master??????

I'd still appreciate any incite that anyone could give.

thanks,
ga
Geoff said:
Hi George,

I don't know the specific answer to your question. However, it seems that
the fields that cannot now be modified may result from the fact that the
form in question is now opening a non-updatable recordset. Perhaps it would
be an idea to try and create an updatable query that drags the data you want
from the place you want and make that the Record Source of the form. See if
that is possible and does the trick. If is is not possible (to create an
updatable query), then perhaps that signposts your direction to checking the
link to the backend server. Does that, in some way, prevent the creation of
an updatable query?

Regards
Geoff.


George Applegate said:
I am having a problem in MS/Access, and I don't know that much about
it and would appreciate any help/direction. Sorry this is so long in
advance.

Over the weekend we moved to a new server. We have an access data
base dealing with warranties and related information. In the access
programs, it referred to a customer master file for name/address/etc.
that was linked to a server data base. When we migrated to the new
server that database went away, however, we have an as/400 that I
changed the pointers and associations to for customer information in
the access database - so, instead of pointing to the server for the
customer data base, it now points to the as/400 for the customer data
base information. Until I did this, I was getting errors when it
would be looking for those customer fields. Once I changed each query
to go to the as/400 customer file/fields everything seemed fine.

Until we open the warranty form. Almost all the fields in the
warranty form now seem protected - I can put my cursor into the field,
but I can't change any of the information. Some fields at the bottom
of the warranty entry form I can update and add information to, but
most of the fields on the form I can't change - and I could before.

What would cause this? I am including the visual basic code at the
bottom of this if someone wants to look at it. I didn't know how much
of the form to upload/or could upload so just did the vb code.

I am also getting a 2105 error at the line in bold (code shown below).
Now I am assuming from what I have found on googling 2105, that I
somehow need to give it more time to load the customer database with
the warranty???? How can I do that in vb?? Suggestions??

But why would these fields, which worked fine before, now suddenly not
be modifiable? Also, when I bring up an existing warranty it's the
right data shown, I just can't hardly change any of the fields - and
it wasn't that way before. The customer fields only come into the
form - but then you can override them; also, the form contains MANY
OTHER FIELDS not in the customer file and none of those can be
modified either. Most of the fields that I can't modify are in the
query that links to the customer file. I think I cannot modify any
fields on the form that come from the warranty file, which is linked
through a query to the customer file. But I can't modify any warranty
fields, whether customer related or not. Also, as I said, I can
update some data on the form and that seems to be "sub-forms". There
are 3 sub-forms. Also, if I just edit the table it works fine, it's
just that I can't change the fields using the form??????

I need to get this working and I am thinking it has to be pretty
simple as all I did was change queries to point to a different
customer file than the one before, but the fields stayed the same. I
can't help but think this is all due to the fact that I changed the
customer file pointer to a new file.but since I didn't get any errors,
I'm not sure why it wouldn't work???

As I said, I'm pretty much a novice at this, I just need to get this
program working and would appreciate any suggestions on why it is
giving me the 2105 error at the point in bold, but more importantly,
WHY CAN'T I ENTER/UPDATE FIELDS on the form that I could before????

Thanks in advance
Ga

Private Declare Function WinExec Lib "kernel32" (ByVal lpCmdLine As
String, ByVal nCmdShow As Long) As Long

Private Sub Command116_Click()
CDOpen.ShowOpen
If CDOpen.FileName = "" Then Exit Sub
[WARRANTY LETTER].SetFocus
[WARRANTY LETTER].Text = CDOpen.FileName
End Sub


Private Sub Command119_Click()
WinExec "winword K:\FORMS\FORMS\300-Customers\310-1AW.DOC", 10
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = KeyAscii - 32
End If
End Sub

Private Sub Form_Load()

If Me.Filter > "" Then
DoCmd.Maximize
Exit Sub
End If

Dim ans As String, ANS2 As String

Me.Visible = False

NewClaim:
ans = InputBox("Enter Claim #")
If ans = "ALL" Then
Form.Visible = True
Exit Sub
End If

If ans <> "" Then
Form.RecordSource = "SELECT [WARRANTY WITH CUST INFO].* FROM
[WARRANTY WITH CUST INFO] WHERE [WARRANTY CLAIM #] = '" & ans & "'"
Form.Refresh
If Form.Recordset.RecordCount = 0 Then
ANS2 = MsgBox("Warranty claim not found. Start new claim?",
vbYesNoCancel)
If ANS2 = vbYes Then
[WARRANTY CLAIM #].SetFocus ---2105 error is here in debug
[WARRANTY CLAIM #].Text = UCase(ans)
VENDOR.SetFocus
ElseIf ANS2 = vbNo Then
GoTo NewClaim
Else
DoCmd.close acForm, "WARRANTY"
Exit Sub
End If
End If
Me.Visible = True

Else
DoCmd.close acForm, "WARRANTY"
End If

End Sub

Private Sub Form_Unload(Cancel As Integer)
If Me.Filter > "" Then
DoCmd.Quit acQuitSaveNone
End If
End Sub

Private Sub openfile_Click()
On Error GoTo Err_openfile_Click
[WARRANTY LETTER].SetFocus

If [WARRANTY LETTER].Text = "" Then
MsgBox "Please find the file to open first by clicking on 'Find
File'"
Else
WinExec "winword """ & [WARRANTY LETTER].Text & """", 10
End If

Exit_openfile_Click:
Exit Sub

Err_openfile_Click:
MsgBox Err.DESCRIPTION
Resume Exit_openfile_Click

End Sub

George Applegate
(e-mail address removed)

George Applegate
(e-mail address removed)
 
G

Geoff

I'm sorry I've not been able to reply until now.

It's a mystery. I'm not able to replicate your situation, so it's impossible
for me to know what's going on. As you've not had any other replies,
no one else appears to have experience of your situation either.

I would have tried turning off the read-only file attribute if that were
possible. (But I don't know what's possible on the as/400.)

If you need to stop users changing the data, then perhaps the form could
have been modified. For example, you could show the relevant data in
disabled (greyed-out) textboxes and prevent new records from being added.

It's odd that the application worked before and not now. Sometimes,
work-arounds are the only solution. They're not always elegant. It seems
you've found one. Sorry I couldn't be more help.

Regards
Geoff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top