read only

M

maximus

Hi!
I have Access 2000 front-end with SQL 2000 DB. Form has
RecordSource set to query which joins 2 tables: tName and
tMailOffice. UniqueTable property on MailOffice form is
set to table tMailOffice. Query looks like this:

SELECT TOP 100 PERCENT dbo.tMailOffice.ID,
dbo.tMailOffice.IDQ,
dbo.tMailOffice.IDT, dbo.UDFGetNamePrefName
(dbo.tName.ID)
AS MailingName, dbo.tMailOffice.Ctrmailed,
dbo.tMailOffice.MailDate, dbo.tMailOffice.AmtDue,
dbo.tMailOffice.PaidDate,
dbo.tMailOffice.TotalPaymentType,
dbo.tMailOffice.Amtpaid, dbo.tMailOffice.BalanceDue,
dbo.tMailOffice.Mailtype,
dbo.tMailOffice.DateChangedtMailOffice,
dbo.tMailOffice.UserNametMailOffice
FROM dbo.tName INNER JOIN
dbo.tMailOffice ON dbo.tName.IDT = dbo.tMailOffice.IDT
AND
dbo.tName.IDQ = dbo.tMailOffice.IDQ AND
dbo.tName.ID = dbo.tMailOffice.ID
ORDER BY dbo.tMailOffice.ID

Form should be automaticaly filling MailingName field
after ID number is typed in ID field. I tryed to do it in
VB code like this:

Private Sub MailingName_Exit(Cancel As Integer)
Dim IDbox, SetID, WhereStr As String
IDbox = Forms!MailOffice!ID.Value
WhereStr = "ID=" & IDbox
DoCmd.OpenForm "NamesSFMailingNameNew", acNormal, ,
WhereStr
SetID = Forms!NamesSFMailingNameNew!MailingName.Value
Forms!MailOffice!MailingName.Value = SetID
End Sub

NamesSFMailingNameNew form runs function which gets first
name + last name for selected ID.
When code execution comes to "Forms!MailOffice!
MailingName.Value = SetID" I get the message that field
can't be updated because it is read only.
What should I do to make MailingName field automaticly
filed when some ID is inputed in ID field?
Thank you
 
J

Jonathan Parminter

Hi Maximus,

seems to me that you need to have a separate unbound field
that you use to enter your search value. then have an
event run a search.

Luck
Jonathan
 
M

maximus

Hi Jonatan,
Thank you for responding. It didn't work with adding
separate unbound field. Do you have any other sugestions?

Maximus
 
M

maximus

Just to correct myself:
When I made MailingName field Unbound, adding new record
was working fine, but i couldn't get other ,old records to
display MailingName. MailingName was changed for all old
records to latest inputed new record. How do I fix that?
 

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