dear all
My requirement is to assign the value of a variable to a field in a form..
For the reverse purpose we can use "getCurrentValue()" property..
But for this what property or method should be used..
Please help me
			
			
													[Solved] How can assign a variable value to a form field
- 
				mohanvarier
 - Posts: 4
 - Joined: Tue Sep 22, 2020 3:56 pm
 
							
						[Solved] How can assign a variable value to a form field
		
													
							
						
			
			
			
			
					Last edited by mohanvarier on Mon Sep 28, 2020 7:40 am, edited 1 time in total.
									
			
						
							OpenOffice 4.1.7  Windows 7 Ultimate
			
						Re: How can assign a variable value to a form field
Hello,
find attached a small example using the following code:
R
			
							find attached a small example using the following code:
Code: Select all
Sub INSERT_UPDATE_ROW
    sNAME = Inputbox("Enter Name, e.g. James","Name","")
    dNUMBER = cdbl(Inputbox("Enter Number, e.g. 12.45","Number","")
    oMainform = Thiscomponent.drawpage.Forms.getbyName("MainForm")
    oMainform.Columns.getbyName("NAME").updatestring(sNAME)
    oMainform.Columns.getbyName("NUMBER").updatedouble(dNUMBER)
    if oMainform.isnew then oMainform.insertrow else oMainform.updaterow
End Sub- Attachments
 - 
			
		
		
				
- Test_update_insert_row.odb
 - (12.94 KiB) Downloaded 309 times
 
 
- MMove 1.0.6
 - Extension for easy, exact positioning of shapes, pictures, controls, frames ...
 
- my current system
 - Windows 11 AOO, LO | Linux Mint AOO, LO
 
- 
				mohanvarier
 - Posts: 4
 - Joined: Tue Sep 22, 2020 3:56 pm
 
Re: How can assign a variable value to a form field
Sir,
Thank you for your response.
sorry, i did't mentioned my correct requirement.
my requirement is in OOb, not in Cal..
from your replay i had tried the procedure ".updatedouble(dNUMBER)" with following modification.
My variable name is "iOpnum" and it is integer.
So i tried as "oControl.upadateinteger(iOpnum)"....."oControl" is my assigned object to the said Form Field
But it gives the error as
BASIC runtime error.
Property or method not found.
please help me
			
			
									
						
							Thank you for your response.
sorry, i did't mentioned my correct requirement.
my requirement is in OOb, not in Cal..
from your replay i had tried the procedure ".updatedouble(dNUMBER)" with following modification.
My variable name is "iOpnum" and it is integer.
So i tried as "oControl.upadateinteger(iOpnum)"....."oControl" is my assigned object to the said Form Field
But it gives the error as
BASIC runtime error.
Property or method not found.
please help me
OpenOffice 4.1.7  Windows 7 Ultimate
			
						Re: How can assign a variable value to a form field
upadateinteger is not a valid method name
updateinteger is
			
			
									
						
							updateinteger is
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
			
						Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: "[Solved]"How can assign a variable value to a form fiel
try 
			
			
									
						
							Code: Select all
updateint()- MMove 1.0.6
 - Extension for easy, exact positioning of shapes, pictures, controls, frames ...
 
- my current system
 - Windows 11 AOO, LO | Linux Mint AOO, LO