I have a form that presents data about company printers in service and the current and new IP address to be assigned. This is all in Access 2010
The form is based off table called PRINTER_INFO
In the form the field that holds the the new IP Address is called [NEWIPADR]
[NEWIPADR] - Short Text (16)
A COMBO bOX IS USED TO REF. THE [REF_IPADR_TABLE]
The To be assigned IP address are stored in a table named [REF_IPADR Table]
Table has 3 fields
Key
NEWIPADR - Short Text (16)
IP ADR USED - Short Text (1)
When I open the form I have Event Form_Load that declares a string value to be used to store the CURRENT value of the [NEWIPADR] the statement is
Dim TMPNIPADR As String
TMPNIPADR = [NEWIPADR]
I have an event ON Change that I want to run an update to update the table [REF_IPADR Table]. [IP ADR Used] to 'N'
This is were I can not get this to work here is the code:
DoCmd.RunSQL "UPDATE [REF_IPADR TABLE] SET [REF_IPADR TABLE].USED = 'N' WHERE [REF_IPADR TABLE].[IPADR] ='"&TMPNIPADR&"'";
Thanks in advance for any help on this. I know it is simple but just cant figure it out. been out of access development for about 8 years so still rusty:banghead:
The form is based off table called PRINTER_INFO
In the form the field that holds the the new IP Address is called [NEWIPADR]
[NEWIPADR] - Short Text (16)
A COMBO bOX IS USED TO REF. THE [REF_IPADR_TABLE]
The To be assigned IP address are stored in a table named [REF_IPADR Table]
Table has 3 fields
Key
NEWIPADR - Short Text (16)
IP ADR USED - Short Text (1)
When I open the form I have Event Form_Load that declares a string value to be used to store the CURRENT value of the [NEWIPADR] the statement is
Dim TMPNIPADR As String
TMPNIPADR = [NEWIPADR]
I have an event ON Change that I want to run an update to update the table [REF_IPADR Table]. [IP ADR Used] to 'N'
This is were I can not get this to work here is the code:
DoCmd.RunSQL "UPDATE [REF_IPADR TABLE] SET [REF_IPADR TABLE].USED = 'N' WHERE [REF_IPADR TABLE].[IPADR] ='"&TMPNIPADR&"'";
Thanks in advance for any help on this. I know it is simple but just cant figure it out. been out of access development for about 8 years so still rusty:banghead: