Vb6中需要运行时错误424对象

Kru*_*nal 0 vb6

我是Vb新手,

我的源代码中出现错误,

这是我的代码段,

Dim a,b as integer 
  a=val (txtf.Text)
  b=val (txts.Text)
    if(a>b)then
       txtr=a
    else
      txtr=b
   end if 
end sub
Run Code Online (Sandbox Code Playgroud)

错误:运行时错误424对象必需:

任何帮助都会得到帮助。

Ahm*_*mad 5

打字更安全

Dim a as Integer
Dim b as integer 
Run Code Online (Sandbox Code Playgroud)

要么

Dim a as integer,b as integer 
Run Code Online (Sandbox Code Playgroud)

这可能是错误的情况